pax_global_header00006660000000000000000000000064140514347630014521gustar00rootroot0000000000000052 comment=6b1d29874dc5d7c3c9201b70e760b3eb9468a60d cpplint-1.5.5/000077500000000000000000000000001405143476300132025ustar00rootroot00000000000000cpplint-1.5.5/.flake8000066400000000000000000000020211405143476300143500ustar00rootroot00000000000000[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 cpplint-1.5.5/.gitignore000066400000000000000000000027431405143476300152000ustar00rootroot00000000000000### 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 cpplint-1.5.5/.pre-commit-hooks.yaml000066400000000000000000000002701405143476300173400ustar00rootroot00000000000000- id: cpplint name: cpplint description: Static code analysis of C/C++ files language: python files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ entry: cpplint cpplint-1.5.5/.pylintrc000066400000000000000000000017421405143476300150530ustar00rootroot00000000000000[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, consider-using-min-builtin, 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 cpplint-1.5.5/.style.yapf000066400000000000000000000001701405143476300152770ustar00rootroot00000000000000[style] based_on_style = chromium dedent_closing_brackets = True coalesce_brackets = True continuation_indent_width = 2 cpplint-1.5.5/.travis.yml000066400000000000000000000003661405143476300153200ustar00rootroot00000000000000language: 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 cpplint-1.5.5/CONTRIBUTING.rst000066400000000000000000000137651405143476300156570ustar00rootroot00000000000000Contributing 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 functionality 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 versions:: 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 # ... pyenv local 2.7.16 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 -e .[dev] # for usage without virtualenv, add --user You can setup your local environment for developing patches for cpplint like this: .. code-block:: bash # run a single test pytest --no-cov cpplint_unittest.py -k testExclude # run a single CLI integration test pytest --no-cov cpplint_clitest.py -k testSillySample # 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 --------- The release process first prepares the documentation, then publishes to testpypi to verify, then releases to real pypi. Testpypi acts like real pypi, so broken releases cannot be deleted. For a typical bugfixing release, no special issue on testpypi is expected (but it's still good practice). To release a new version: .. code-block:: bash # prepare files for release vi cpplint.py # increment the version vi changelog.rst # log changes git add cpplint.py changelog.rst git commit -m "Releasing x.y.z" # test-release (on env by mkvirtualenv -p /usr/bin/python3) pip install --upgrade setuptools wheel twine rm -rf dist # Test release, requires account on testpypi 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 --tags After releasing, it is be good practice to comment on github for closed tickets, to notify authors. 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 (though these updates happen once per year and less). 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 ## Merge workflow (clean, no new commits) git checkout master -b updates git merge google/gh-pages # this will have a lot of conflicts # ... solve conflicts git merge -- continue ## Rebase workflow (dirty, creates new commits) 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 cpplint-1.5.5/LICENSE000066400000000000000000000027361405143476300142170ustar00rootroot00000000000000cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google Inc. 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. cpplint-1.5.5/MANIFEST.in000066400000000000000000000005551405143476300147450ustar00rootroot00000000000000# 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 cpplint-1.5.5/README.rst000066400000000000000000000052421405143476300146740ustar00rootroot00000000000000cpplint - 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, such as: * python 3 compatibility * more default file extensions * 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 * ... and a few more (most of which are open PRs on upstream) Acknowledgements ---------------- Thanks to Google Inc. for open-sourcing their in-house tool. Thanks to maintainers of the fork * `tkruse `_ * `mattyclarkson `_ * `theandrewdavis `_ cpplint-1.5.5/changelog.rst000066400000000000000000000126651405143476300156750ustar00rootroot00000000000000Changelog ========= 1.5.5 (2021-05-20) ----- * Fix #172: Added 'size_t' to typecasts detected by CheckCStyleCast * Fixed wrong CLI help text: Each filter needs + or - * Fix #164: add elif as an exception for CheckSpacingForFunctionCall() * Fix google#346: --root option not working on windows due to slashes in path 1.5.4 (2020-08-18) ----- * Fix google#166, Allow space before C++11 attributes 1.5.3 (2020-07-20) ----- * Fix #156: sed/gsed output parameter rejected * Fix #156: sed/gsed output without other stdout information * improvements to regression tests 1.5.2 (2020-06-24) ----- * Fix #83, output formats "sed" and "gsed" to auto-fix some issues * Fix #92, new category "build/namespaces_headers" for unnamed namespaces in header file * Sort list of files before processing * Fix #144 Falso positive for indent when using QT macros "signals" and "slots" * Fix #76 Parsing of class decorators that also use digits * Fix #139 Add message "Relative paths like . and .. are not allowed" 1.5.1 (2020-06-05) ----- * Revert #43 behavior change for include order from 1.5.0, and hide it behind command-line-flag `--includeorder=standardcfirst`. It turns out there is no easy objective way to tell c system headers from certain c++ library headers, and Google cpplint intentionally classifies some C++ header includes as C system header for simplicity. * Libraries considered as C system headers using --includeorder=standardcfirst now also includes linux-specifc headers (glibc-devel, glibc-kernheaders, linux-libc-dev). 1.5.0 (2020-05-31) ----- * Fix #43 false positives in header include order by checking includes against a list of c headers. Since this interprets certain include lines different than before, output about header include order changes. 1.4.6 (2020-05-31) ----- * Fix #135: allow 'if constexpr' in readability/braces. * Fix runtime warning: Close files after reading contents 1.4.5 (2020-01-13) ----- * 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 (2019-02-25) ----- 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 (2019-02-18) ----- * Revert "Fix the `build/endif_comment` check", same as reverted in upstream 1.4.2 (2019-02-17) ----- * Cleanup release, fixes further issues with tests and source distribution 1.4.1 (2019-02-17) ----- * Cleanup release, only adds test support files to source dist 1.4.0 (2019-02-17) ----- * 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 (2016-07-12) ----- * 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 (2016-04-07) ----- * Fixes bug causing RValue detection with namespaces to fail. 1.2.1 (2016-03-19) ----- * Fixes error in setup.py. 1.2.0 (2016-03-19) ----- * 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 (2016-02-24) ----- * Adds quiet option to suppress non error-related output. 1.0.1 (2016-02-12) ----- * Updates PyPi README. 1.0.0 (2016-02-03) ----- * Fixes a --repository flag bug. 0.0.9 (2016-01-23) ----- * Adds the --exclude flag to exclude files from being linted. 0.0.8 (2016-01-18) ----- * 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 (2016-01-07) ----- * Fixes a Windows include guard bug. * Adds escaping and more detail to JUnit XML output. 0.0.6 (2015-12-15) ----- * Adds the --recursive flag. * Adds JUnit XML output. 0.0.5 (2015-01-04) ----- * Maintenance release, undoes earlier project folder structure changes to remain as true to upstream as possible. 0.0.4 (2015-01-04) ----- * 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 (2012-11-24) ----- * python 3 compatibility 0.0.2 (2012-11-06) ----- * fixed and extended allowed extensions 0.0.1 (2012-10-13) ----- * import from googlecode, added setup.py * imported revision r83 (2012-05-11) cpplint-1.5.5/cpplint.py000077500000000000000000007777321405143476300152570ustar00rootroot00000000000000#!/usr/bin/env python # # 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. """Does google-lint on c++ files. The goal of this script is to identify places in the code that *may* be in non-compliance with google style. It does not attempt to fix up these problems -- the point is to educate. It does also not attempt to find all problems, or to ensure that everything it does find is legitimately a problem. In particular, we can get very confused by /* and // inside strings! We do a small hack, which is to ignore //'s with "'s after them on the same line, but it is far from perfect (in either direction). """ 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.5.5' try: xrange # Python 2 except NameError: # -- pylint: disable=redefined-builtin xrange = range # Python 3 _USAGE = """ Syntax: cpplint.py [--verbose=#] [--output=emacs|eclipse|vs7|junit|sed|gsed] [--filter=-x,+y,...] [--counting=total|toplevel|detailed] [--root=subdir] [--repository=path] [--linelength=digits] [--headers=x,y,...] [--recursive] [--exclude=path] [--extensions=hpp,cpp,...] [--includeorder=default|standardcfirst] [--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 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. This will miss some errors, and is not a substitute for a code review. To suppress false-positive errors of a certain category, add a 'NOLINT(category)' comment to the line. NOLINT or NOLINT(*) 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 %s. Other file types will be ignored. Change the extensions with the --extensions flag. Flags: output=emacs|eclipse|vs7|junit|sed|gsed By default, the output is formatted to ease emacs parsing. Visual Studio 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. The sed format outputs sed commands that should fix some of the errors. Note that this requires gnu sed. If that is installed as gsed on your system (common e.g. on macOS with homebrew) you can use the gsed output format. Sed commands are written to stdout, not stderr, so you should be able to pipe output straight to a shell to run the fixes. 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 error messages whose category names pass the filters will be printed. (Category names are printed with the message and look like "[whitespace/indent]".) Filters are evaluated left to right. "-FOO" means "do not print categories that start with FOO". "+FOO" means "do print categories that start with FOO". Examples: --filter=-whitespace,+whitespace/braces --filter=-whitespace,-runtime/printf,+runtime/printf_format --filter=-,+build/include_what_you_use To see a list of all the categories used in cpplint, pass no arg: --filter= counting=total|toplevel|detailed The total number of errors found is always printed. If 'toplevel' is provided, then the count of errors in each of the top-level categories like 'build' and 'whitespace' will 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. 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 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 80 characters. 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=%s includeorder=default|standardcfirst For the build/include_order rule, the default is to blindly assume angle bracket includes with file extension are c-system-headers (default), even knowing this will have false classifications. The default is established at google. standardcfirst means to instead use an allow-list of known c headers and treat all others as separate group of "other system headers". The C headers included are those of the C-standard lib and closely related ones. 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. Currently the following options are supported: set noparent 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 is usually placed in the top-level project directory. The "filter" option is similar in function to --filter flag. It specifies message filters in addition to the |_DEFAULT_FILTERS| and those specified through --filter command-line flag. "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 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 The above example disables build/include_order warning and enables build/include_alpha as well as excludes all .cc from being processed by linter, in the current directory (where the .cfg file is located) and all sub-directories. """ # We categorize each error message we print. Here are the categories. # We want an explicit list so we can list them all in cpplint --filter=. # If you add a new error message with a new category, add it to the list # here! cpplint_unittest.py should tell you if you forget to do this. _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_headers', 'build/namespaces_literals', 'build/namespaces', 'build/printf_format', 'build/storage_class', 'legal/copyright', 'readability/alt_tokens', 'readability/braces', 'readability/casting', 'readability/check', 'readability/constructors', 'readability/fn_size', 'readability/inheritance', 'readability/multiline_comment', 'readability/multiline_string', 'readability/namespace', 'readability/nolint', 'readability/nul', 'readability/strings', 'readability/todo', 'readability/utf8', 'runtime/arrays', 'runtime/casting', 'runtime/explicit', 'runtime/int', 'runtime/init', 'runtime/invalid_increment', 'runtime/member_string_references', 'runtime/memset', 'runtime/indentation_namespace', 'runtime/operator', 'runtime/printf', 'runtime/printf_format', 'runtime/references', 'runtime/string', 'runtime/threadsafe_fn', 'runtime/vlog', 'whitespace/blank_line', 'whitespace/braces', 'whitespace/comma', 'whitespace/comments', 'whitespace/empty_conditional_body', 'whitespace/empty_if_body', 'whitespace/empty_loop_body', 'whitespace/end_of_line', 'whitespace/ending_newline', 'whitespace/forcolon', 'whitespace/indent', 'whitespace/line_length', 'whitespace/newline', 'whitespace/operators', 'whitespace/parens', 'whitespace/semicolon', 'whitespace/tab', 'whitespace/todo', ] # keywords to use with --outputs which generate stdout for machine processing _MACHINE_OUTPUTS = [ 'junit', 'sed', 'gsed' ] # These error categories are no longer enforced by cpplint, but for backwards- # 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= # flag. By default all errors are on, so only add here categories that should be # off by default (i.e., categories that must be enabled by the --filter= flags). # 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. # C++ headers _CPP_HEADERS = frozenset([ # Legacy 'algobase.h', 'algo.h', 'alloc.h', 'builtinbuf.h', 'bvector.h', 'complex.h', 'defalloc.h', 'deque.h', 'editbuf.h', 'fstream.h', 'function.h', 'hash_map', 'hash_map.h', 'hash_set', 'hash_set.h', 'hashtable.h', 'heap.h', 'indstream.h', 'iomanip.h', 'iostream.h', 'istream.h', 'iterator.h', 'list.h', 'map.h', 'multimap.h', 'multiset.h', 'ostream.h', 'pair.h', 'parsestream.h', 'pfstream.h', 'procbuf.h', 'pthread_alloc', 'pthread_alloc.h', 'rope', 'rope.h', 'ropeimpl.h', 'set.h', 'slist', 'slist.h', 'stack.h', 'stdiostream.h', 'stl_alloc.h', 'stl_relops.h', 'streambuf.h', 'stream.h', 'strfile.h', 'strstream.h', 'tempbuf.h', 'tree.h', 'type_traits.h', 'vector.h', # 17.6.1.2 C++ library headers 'algorithm', 'array', 'atomic', 'bitset', 'chrono', 'codecvt', 'complex', 'condition_variable', 'deque', 'exception', 'forward_list', 'fstream', 'functional', 'future', 'initializer_list', 'iomanip', 'ios', 'iosfwd', 'iostream', 'istream', 'iterator', 'limits', 'list', 'locale', 'map', 'memory', 'mutex', 'new', 'numeric', 'ostream', 'queue', 'random', 'ratio', 'regex', 'scoped_allocator', 'set', 'sstream', 'stack', 'stdexcept', 'streambuf', 'string', 'strstream', 'system_error', 'thread', 'tuple', 'typeindex', 'typeinfo', 'type_traits', 'unordered_map', 'unordered_set', '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', 'cctype', 'cerrno', 'cfenv', 'cfloat', 'cinttypes', 'ciso646', 'climits', 'clocale', 'cmath', 'csetjmp', 'csignal', 'cstdalign', 'cstdarg', 'cstdbool', 'cstddef', 'cstdint', 'cstdio', 'cstdlib', 'cstring', 'ctgmath', 'ctime', 'cuchar', 'cwchar', 'cwctype', ]) # C headers _C_HEADERS = frozenset([ # System C headers 'assert.h', 'complex.h', 'ctype.h', 'errno.h', 'fenv.h', 'float.h', 'inttypes.h', 'iso646.h', 'limits.h', 'locale.h', 'math.h', 'setjmp.h', 'signal.h', 'stdalign.h', 'stdarg.h', 'stdatomic.h', 'stdbool.h', 'stddef.h', 'stdint.h', 'stdio.h', 'stdlib.h', 'stdnoreturn.h', 'string.h', 'tgmath.h', 'threads.h', 'time.h', 'uchar.h', 'wchar.h', 'wctype.h', # additional POSIX C headers 'aio.h', 'arpa/inet.h', 'cpio.h', 'dirent.h', 'dlfcn.h', 'fcntl.h', 'fmtmsg.h', 'fnmatch.h', 'ftw.h', 'glob.h', 'grp.h', 'iconv.h', 'langinfo.h', 'libgen.h', 'monetary.h', 'mqueue.h', 'ndbm.h', 'net/if.h', 'netdb.h', 'netinet/in.h', 'netinet/tcp.h', 'nl_types.h', 'poll.h', 'pthread.h', 'pwd.h', 'regex.h', 'sched.h', 'search.h', 'semaphore.h', 'setjmp.h', 'signal.h', 'spawn.h', 'strings.h', 'stropts.h', 'syslog.h', 'tar.h', 'termios.h', 'trace.h', 'ulimit.h', 'unistd.h', 'utime.h', 'utmpx.h', 'wordexp.h', # additional GNUlib headers 'a.out.h', 'aliases.h', 'alloca.h', 'ar.h', 'argp.h', 'argz.h', 'byteswap.h', 'crypt.h', 'endian.h', 'envz.h', 'err.h', 'error.h', 'execinfo.h', 'fpu_control.h', 'fstab.h', 'fts.h', 'getopt.h', 'gshadow.h', 'ieee754.h', 'ifaddrs.h', 'libintl.h', 'mcheck.h', 'mntent.h', 'obstack.h', 'paths.h', 'printf.h', 'pty.h', 'resolv.h', 'shadow.h', 'sysexits.h', 'ttyent.h', # Additional linux glibc headers 'dlfcn.h', 'elf.h', 'features.h', 'gconv.h', 'gnu-versions.h', 'lastlog.h', 'libio.h', 'link.h', 'malloc.h', 'memory.h', 'netash/ash.h', 'netatalk/at.h', 'netax25/ax25.h', 'neteconet/ec.h', 'netipx/ipx.h', 'netiucv/iucv.h', 'netpacket/packet.h', 'netrom/netrom.h', 'netrose/rose.h', 'nfs/nfs.h', 'nl_types.h', 'nss.h', 're_comp.h', 'regexp.h', 'sched.h', 'sgtty.h', 'stab.h', 'stdc-predef.h', 'stdio_ext.h', 'syscall.h', 'termio.h', 'thread_db.h', 'ucontext.h', 'ustat.h', 'utmp.h', 'values.h', 'wait.h', 'xlocale.h', # Hardware specific headers 'arm_neon.h', 'emmintrin.h', 'xmmintin.h', ]) # Folders of C libraries so commonly used in C++, # that they have parity with standard C libraries. C_STANDARD_HEADER_FOLDERS = frozenset([ # standard C library "sys", # glibc for linux "arpa", "asm-generic", "bits", "gnu", "net", "netinet", "protocols", "rpc", "rpcsvc", "scsi", # linux kernel header "drm", "linux", "misc", "mtd", "rdma", "sound", "video", "xen", ]) # 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: # - Anything not following google file name conventions (containing an # uppercase character, such as Python.h or nsStringAPI.h, for example). # - Lua headers. _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/public/gunit.h. _CHECK_MACROS = [ 'DCHECK', 'CHECK', 'EXPECT_TRUE', 'ASSERT_TRUE', 'EXPECT_FALSE', 'ASSERT_FALSE', ] # Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE _CHECK_REPLACEMENT = dict([(macro_var, {}) for macro_var in _CHECK_MACROS]) for op, replacement in [('==', 'EQ'), ('!=', 'NE'), ('>=', 'GE'), ('>', 'GT'), ('<=', 'LE'), ('<', 'LT')]: _CHECK_REPLACEMENT['DCHECK'][op] = 'DCHECK_%s' % replacement _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % 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 # Alternative tokens and their replacements. For full list, see section 2.5 # Alternative tokens [lex.digraph] in the C++ standard. # # Digraphs (such as '%:') are not included here since it's a mess to # match those on a word boundary. _ALT_TOKEN_REPLACEMENT = { 'and': '&&', 'bitor': '|', 'or': '||', 'xor': '^', 'compl': '~', 'bitand': '&', 'and_eq': '&=', 'or_eq': '|=', 'xor_eq': '^=', 'not': '!', 'not_eq': '!=' } # Compile regular expression that matches all the above keywords. The "[ =()]" # bit is meant to avoid matching these keywords outside of boolean expressions. # # False positives include C-style multi-line comments and multi-line strings # but those have always been troublesome for cpplint. _ALT_TOKEN_REPLACEMENT_PATTERN = re.compile( r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)') # These constants define types of headers for use with # _IncludeState.CheckNextIncludeOrder(). _C_SYS_HEADER = 1 _CPP_SYS_HEADER = 2 _OTHER_SYS_HEADER = 3 _LIKELY_MY_HEADER = 4 _POSSIBLE_MY_HEADER = 5 _OTHER_HEADER = 6 # These constants define the current inline assembly state _NO_ASM = 0 # Outside of inline assembly block _INSIDE_ASM = 1 # Inside inline assembly block _END_ASM = 2 # Last line of inline assembly block _BLOCK_ASM = 3 # The whole block is an inline assembly block # Match start of assembly blocks _MATCH_ASM = re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)' 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)') # Commands for sed to fix the problem _SED_FIXUPS = { 'Remove spaces around =': r's/ = /=/', 'Remove spaces around !=': r's/ != /!=/', 'Remove space before ( in if (': r's/if (/if(/', 'Remove space before ( in for (': r's/for (/for(/', 'Remove space before ( in while (': r's/while (/while(/', 'Remove space before ( in switch (': r's/switch (/switch(/', 'Should have a space between // and comment': r's/\/\//\/\/ /', 'Missing space before {': r's/\([^ ]\){/\1 {/', 'Tab found, replace by spaces': r's/\t/ /g', 'Line ends in whitespace. Consider deleting these extra spaces.': r's/\s*$//', 'You don\'t need a ; after a }': r's/};/}/', 'Missing space after ,': r's/,\([^ ]\)/, \1/g', } _regexp_compile_cache = {} # {str, set(int)}: a map from error categories to sets of linenumbers # on which those errors are expected and should be suppressed. _error_suppressions = {} # 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 all PrintInfo messages, UNRELATED to --quiet flag _quiet = False # The allowed line length of files. # This is set by --linelength flag. _line_length = 80 # This allows to use different include order rule than default _include_order = "default" 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 ProcessIncludeOrderOption(val): if val is None or val == "default": pass elif val == "standardcfirst": global _include_order _include_order = val else: PrintUsage('Invalid includeorder value %s. Expected default|standardcfirst') 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 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 line error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. linenum: int, the number of the current line. error: function, an error handler. """ matched = Search(r'\bNOLINT(NEXTLINE)?\b(\([^)]+\))?', raw_line) if matched: if matched.group(1): suppressed_line = linenum + 1 else: suppressed_line = linenum category = matched.group(2) if category in (None, '(*)'): # => "suppress all" _error_suppressions.setdefault(None, set()).add(suppressed_line) else: if category.startswith('(') and category.endswith(')'): category = category[1:-1] if category in _ERROR_CATEGORIES: _error_suppressions.setdefault(category, set()).add(suppressed_line) elif category not in _LEGACY_ERROR_CATEGORIES: error(filename, linenum, 'readability/nolint', 5, '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/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 or global suppression. """ return (_global_error_suppressions.get(category, False) or linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set())) def Match(pattern, s): """Matches the string with the pattern, caching the compiled regexp.""" # The regexp compilation caching is inlined in both Match and Search for # performance reasons; factoring it out into a separate function turns out # to be noticeably expensive. if pattern not in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].match(s) def ReplaceAll(pattern, rep, s): """Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if no replacements) """ if pattern not in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].sub(rep, s) def Search(pattern, s): """Searches the string for the pattern, caching the compiled regexp.""" if pattern not in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) 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. include_list contains list of lists of (header, line number) pairs. It's a lists of lists rather than just one flat list to make it easier to update across preprocessor boundaries. Call CheckNextIncludeOrder() once for each header in the file, passing in the type constants defined above. Calls in an illegal order will raise an _IncludeError with an appropriate error message. """ # self._section will move monotonically through this set. If it ever # needs to move backwards, CheckNextIncludeOrder will raise an error. _INITIAL_SECTION = 0 _MY_H_SECTION = 1 _C_SECTION = 2 _CPP_SECTION = 3 _OTHER_SYS_SECTION = 4 _OTHER_H_SECTION = 5 _TYPE_NAMES = { _C_SYS_HEADER: 'C system header', _CPP_SYS_HEADER: 'C++ system header', _OTHER_SYS_HEADER: 'other system header', _LIKELY_MY_HEADER: 'header this file implements', _POSSIBLE_MY_HEADER: 'header this file may implement', _OTHER_HEADER: 'other header', } _SECTION_NAMES = { _INITIAL_SECTION: "... nothing. (This can't be an error.)", _MY_H_SECTION: 'a header this file implements', _C_SECTION: 'C system header', _CPP_SECTION: 'C++ system header', _OTHER_SYS_SECTION: 'other system header', _OTHER_H_SECTION: 'other header', } def __init__(self): self.include_list = [[]] self._section = None self._last_header = None self.ResetSection('') def FindHeader(self, header): """Check if a header has already been included. Args: header: header to check. Returns: Line number of previous occurrence, or -1 if the header has not been seen before. """ for section_list in self.include_list: for f in section_list: if f[0] == header: return f[1] return -1 def ResetSection(self, directive): """Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else"). """ # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' # Update list of includes. Note that we never pop from the # include list. if directive in ('if', 'ifdef', 'ifndef'): self.include_list.append([]) elif directive in ('else', 'elif'): self.include_list[-1] = [] def SetLastHeader(self, header_path): self._last_header = header_path def CanonicalizeAlphabeticalOrder(self, header_path): """Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Returns: Canonicalized path. """ return header_path.replace('-inl.h', '.h').replace('-', '_').lower() def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path): """Check if a header is in alphabetical order with the previous header. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. header_path: Canonicalized header to be checked. Returns: Returns true if the header is in alphabetical order. """ # If previous section is different from current section, _last_header will # be reset to empty string, so it's always less than current header. # # If previous line was a blank line, assume that the headers are # intentionally sorted the way they are. if (self._last_header > header_path and Match(r'^\s*#\s*include\b', clean_lines.elided[linenum - 1])): return False return True def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or an error message describing what's wrong. """ error_message = ('Found %s after %s' % (self._TYPE_NAMES[header_type], self._SECTION_NAMES[self._section])) last_section = self._section if header_type == _C_SYS_HEADER: if self._section <= self._C_SECTION: self._section = self._C_SECTION else: self._last_header = '' return error_message elif header_type == _CPP_SYS_HEADER: if self._section <= self._CPP_SECTION: self._section = self._CPP_SECTION else: self._last_header = '' return error_message elif header_type == _OTHER_SYS_HEADER: if self._section <= self._OTHER_SYS_SECTION: self._section = self._OTHER_SYS_SECTION else: self._last_header = '' return error_message elif header_type == _LIKELY_MY_HEADER: if self._section <= self._MY_H_SECTION: self._section = self._MY_H_SECTION else: self._section = self._OTHER_H_SECTION elif header_type == _POSSIBLE_MY_HEADER: if self._section <= self._MY_H_SECTION: self._section = self._MY_H_SECTION else: # This will always be the fallback because we're not sure # enough that the header is associated with this file. self._section = self._OTHER_H_SECTION else: assert header_type == _OTHER_HEADER self._section = self._OTHER_H_SECTION if last_section != self._section: self._last_header = '' return '' class _CppLintState(object): """Maintains module-wide state..""" def __init__(self): self.verbose_level = 1 # global setting. self.error_count = 0 # global count of reported errors # filters to apply when emitting error messages self.filters = _DEFAULT_FILTERS[:] # backup of filter list. Used to restore the state after each file. 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 # "sed" - returns a gnu sed command to fix the problem # "gsed" - like sed, but names the command gsed, e.g. for macOS homebrew users 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 self.verbose_level = level return last_verbose_level def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style def SetFilters(self, filters): """Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Raises: ValueError: The comma-separated filters did not all start with '+' or '-'. E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" """ # Default filters always have less priority than the flag ones. self.filters = _DEFAULT_FILTERS[:] self.AddFilters(filters) def AddFilters(self, filters): """ Adds more filters to the existing list of error-message filters. """ for filt in filters.split(','): clean_filt = filt.strip() if clean_filt: self.filters.append(clean_filt) for filt in self.filters: if not (filt.startswith('+') or filt.startswith('-')): raise ValueError('Every filter in --filters must start with + or -' ' (%s does not)' % filt) def BackupFilters(self): """ Saves the current filter list to backup storage.""" self._filters_backup = self.filters[:] def RestoreFilters(self): """ Restores filters previously backed up.""" self.filters = self._filters_backup[:] def ResetErrorCounts(self): """Sets the module's error statistic back to zero.""" self.error_count = 0 self.errors_by_category = {} def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_category[category] = 0 self.errors_by_category[category] += 1 def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in sorted(iteritems(self.errors_by_category)): self.PrintInfo('Category \'%s\' errors found: %d\n' % (category, count)) if self.error_count > 0: self.PrintInfo('Total errors found: %d\n' % self.error_count) def PrintInfo(self, message): # _quiet does not represent --quiet flag. # Hide infos from stdout to keep stdout pure for machine consumption if not _quiet and self.output_format not in _MACHINE_OUTPUTS: 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() def _OutputFormat(): """Gets the module's output format.""" return _cpplint_state.output_format 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.""" return _cpplint_state.verbose_level def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level) def _SetCountingStyle(level): """Sets the module's counting options.""" _cpplint_state.SetCountingStyle(level) def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters def _SetFilters(filters): """Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint_state.SetFilters(filters) def _AddFilters(filters): """Adds more filter overrides. Unlike _SetFilters, this function does not reset the current list of filters available. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint_state.AddFilters(filters) def _BackupFilters(): """ Saves the current filter list to backup storage.""" _cpplint_state.BackupFilters() def _RestoreFilters(): """ Restores filters previously backed up.""" _cpplint_state.RestoreFilters() class _FunctionState(object): """Tracks current function name and the number of lines in its body.""" _NORMAL_TRIGGER = 250 # for --v=0, 500 for --v=1, etc. _TEST_TRIGGER = 400 # about 50% more than _NORMAL_TRIGGER. def __init__(self): self.in_a_function = False self.lines_in_function = 0 self.current_function = '' def Begin(self, function_name): """Start analyzing function body. Args: function_name: The name of the function being tracked. """ self.in_a_function = True self.lines_in_function = 0 self.current_function = function_name def Count(self): """Count line in current function body.""" if self.in_a_function: self.lines_in_function += 1 def Check(self, error, filename, linenum): """Report if too many lines in function body. Args: error: The function to call with any errors found. 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: base_trigger = self._NORMAL_TRIGGER trigger = base_trigger * 2**_VerboseLevel() if self.lines_in_function > trigger: error_level = int(math.log(self.lines_in_function / base_trigger, 2)) # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ... if error_level > 5: error_level = 5 error(filename, linenum, 'readability/fn_size', error_level, 'Small and focused functions are preferred:' ' %s has %d non-comment lines' ' (error triggered by exceeding %d lines).' % ( self.current_function, self.lines_in_function, trigger)) def End(self): """Stop analyzing function body.""" self.in_a_function = False class _IncludeError(Exception): """Indicates a problem with the include order in a file.""" pass class FileInfo(object): """Provides utility functions for filenames. FileInfo provides easy access to the components of a file's path relative to the project root. """ def __init__(self, filename): self._filename = filename def FullName(self): """Make Windows paths like Unix.""" return os.path.abspath(self._filename).replace('\\', '/') def RepositoryName(self): 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 people on different computers who have checked the source out to different locations won't see bogus errors. """ fullname = self.FullName() 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 root_dir = project_dir one_up_dir = os.path.dirname(root_dir) while os.path.exists(os.path.join(one_up_dir, ".svn")): root_dir = os.path.dirname(root_dir) one_up_dir = os.path.dirname(one_up_dir) prefix = os.path.commonprefix([root_dir, project_dir]) return fullname[len(prefix) + 1:] # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by # searching up from the current path. 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 os.path.exists(os.path.join(root_dir, ".svn"))): prefix = os.path.commonprefix([root_dir, project_dir]) return fullname[len(prefix) + 1:] # Don't know what to do; header guard warnings may be wrong... return fullname def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os.path.split(googlename) return (project,) + os.path.splitext(rest) def BaseName(self): """File base name - text after the final slash, before the final period.""" return self.Split()[1] def Extension(self): """File extension - text following the final period, includes that period.""" return self.Split()[2] def NoExtension(self): """File has no source file extension.""" return '/'.join(self.Split()[0:2]) def IsSource(self): """File has a source file extension.""" return _IsSourceExtension(self.Extension()[1:]) def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters filter it out. if IsErrorSuppressedByNolint(category, linenum): return False if confidence < _cpplint_state.verbose_level: return False is_filtered = False for one_filter in _Filters(): if one_filter.startswith('-'): if category.startswith(one_filter[1:]): is_filtered = True elif one_filter.startswith('+'): if category.startswith(one_filter[1:]): is_filtered = False else: assert False # should have been checked for in SetFilter. if is_filtered: return False return True def Error(filename, linenum, category, confidence, message): """Logs the fact we've found a lint error. We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified. False positives can be suppressed by the use of "cpplint(category)" comments on the offending line. These are parsed into _error_suppressions. Args: filename: The name of the file containing the error. linenum: The number of the line containing the error. category: A string used to describe the "category" this bug falls under: "whitespace", say, or "runtime". Categories may have a hierarchy separated by slashes: "whitespace/indent". confidence: A number from 1-5 representing a confidence score for the error, with 5 meaning that we are certain of the problem, and 1 meaning that it could be a legitimate construct. message: The error message. """ if _ShouldPrintError(category, confidence, linenum): _cpplint_state.IncrementErrorCount(category) if _cpplint_state.output_format == 'vs7': _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) elif _cpplint_state.output_format in ['sed', 'gsed']: if message in _SED_FIXUPS: sys.stdout.write(_cpplint_state.output_format + " -i '%s%s' %s # %s [%s] [%d]\n" % ( linenum, _SED_FIXUPS[message], filename, message, category, confidence)) else: sys.stderr.write('# %s:%s: "%s" [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) else: 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( r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)') # Match a single C style comment on the same line. _RE_PATTERN_C_COMMENTS = r'/\*(?:[^*]|\*(?!/))*\*/' # Matches multi-line C style comments. # This RE is a little bit more complicated than one might expect, because we # have to take care of space removals tools so we can handle comments inside # statements better. # The current rule is: We only clear spaces from both sides when we're at the # end of the line. Otherwise, we try to remove spaces from the right side, # if this doesn't work we try on left side but only if there's a non-character # on the right. _RE_PATTERN_CLEANSE_LINE_C_COMMENTS = re.compile( r'(\s*' + _RE_PATTERN_C_COMMENTS + r'\s*$|' + _RE_PATTERN_C_COMMENTS + r'\s+|' + r'\s+' + _RE_PATTERN_C_COMMENTS + r'(?=\W)|' + _RE_PATTERN_C_COMMENTS + r')') def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant. """ line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 def CleanseRawStrings(raw_lines): """Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Returns: list of lines with C++11 raw strings replaced by empty strings. """ delimiter = None lines_without_raw_strings = [] for line in raw_lines: if delimiter: # Inside a raw string, look for the end end = line.find(delimiter) if end >= 0: # Found the end of the string, match leading space for this # line and resume copying the original lines, and also insert # a "" on the last line. leading_space = Match(r'^(\s*)\S', line) line = leading_space.group(1) + '""' + line[end + len(delimiter):] delimiter = None else: # Haven't found the end yet, append a blank line. line = '""' # Look for beginning of a raw string, and replace them with # empty strings. This is done in a loop to handle multiple raw # strings on the same line. while delimiter is None: # Look for beginning of a raw string. # See 2.14.15 [lex.string] for syntax. # # 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) if end >= 0: # Raw string ended on same line line = (matched.group(1) + '""' + matched.group(3)[end + len(delimiter):]) delimiter = None else: # Start of a multi-line raw string line = matched.group(1) + '""' else: break lines_without_raw_strings.append(line) # TODO(unknown): if delimiter is not None here, we might want to # emit a warning for unterminated string. return lines_without_raw_strings def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return lineix lineix += 1 return len(lines) def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines) def RemoveMultiLineCommentsFromRange(lines, begin, end): """Clears a range of lines for multi-line comments.""" # Having // comments makes the lines non-empty, so we will not get # unnecessary blank line warnings later in the code. for i in range(begin, end): lines[i] = '/**/' def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) if lineix_end >= len(lines): error(filename, lineix_begin + 1, 'readability/multiline_comment', 5, 'Could not find end of multi-line comment') return RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) lineix = lineix_end + 1 def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos].rstrip() # get rid of /* ... */ return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) class CleansedLines(object): """Holds 4 copies of all lines with different preprocessing applied to them. 1) elided member contains lines without strings and comments. 2) lines member contains lines without comments. 3) raw_lines member contains all the lines without processing. 4) lines_without_raw_strings member is same as raw_lines, but with C++11 raw strings removed. All these members are of , and of the same length. """ def __init__(self, lines): self.elided = [] self.lines = [] self.raw_lines = lines self.num_lines = len(lines) self.lines_without_raw_strings = CleanseRawStrings(lines) for linenum in range(len(self.lines_without_raw_strings)): self.lines.append(CleanseComments( self.lines_without_raw_strings[linenum])) elided = self._CollapseStrings(self.lines_without_raw_strings[linenum]) self.elided.append(CleanseComments(elided)) def NumLines(self): """Returns the number of lines represented.""" return self.num_lines @staticmethod def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if _RE_PATTERN_INCLUDE.match(elided): return elided # Remove escaped characters first to make quote/single quote collapsing # basic. Things that look like escaped characters shouldn't occur # outside of strings and chars. elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided) # Replace quoted strings and digit separators. Both single quotes # and double quotes are processed in the same loop, otherwise # nested quotes wouldn't work. collapsed = '' while True: # Find the first quote character match = Match(r'^([^\'"]*)([\'"])(.*)$', elided) if not match: collapsed += elided break head, quote, tail = match.groups() if quote == '"': # Collapse double quoted strings second_quote = tail.find('"') if second_quote >= 0: collapsed += head + '""' elided = tail[second_quote + 1:] else: # Unmatched double quote, don't bother processing the rest # of the line since this is probably a multiline string. collapsed += elided break else: # Found single quote, check nearby text to eliminate digit separators. # # There is no special handling for floating point here, because # the integer/fractional/exponent parts would all be parsed # correctly as long as there are digits on both sides of the # separator. So we are fine as long as we don't see something # like "0.'3" (gcc 4.9.0 will not allow this literal). if Search(r'\b(?:0[bBxX]?|[1-9])[0-9a-fA-F]*$', head): match_literal = Match(r'^((?:\'?[0-9a-zA-Z_])*)(.*)$', "'" + tail) collapsed += head + match_literal.group(1).replace("'", '') elided = match_literal.group(2) else: second_quote = tail.find('\'') if second_quote >= 0: collapsed += head + "''" elided = tail[second_quote + 1:] else: # Unmatched single quote collapsed += elided break return collapsed def FindEndOfExpressionInLine(line, startpos, stack): """Find the position just after the end of current parenthesized expression. Args: line: a CleansedLines line. startpos: start searching at this position. stack: nesting stack at startpos. Returns: On finding matching end: (index just after matching end, None) On finding an unclosed expression: (-1, None) Otherwise: (-1, new stack at end of this line) """ for i in xrange(startpos, len(line)): char = line[i] if char in '([{': # Found start of parenthesized expression, push to expression stack stack.append(char) elif char == '<': # Found potential start of template argument list if i > 0 and line[i - 1] == '<': # Left shift operator if stack and stack[-1] == '<': stack.pop() if not stack: return (-1, None) elif i > 0 and Search(r'\boperator\s*$', line[0:i]): # operator<, don't add to stack continue else: # Tentative start of template argument list stack.append('<') elif char in ')]}': # Found end of parenthesized expression. # # If we are currently expecting a matching '>', the pending '<' # must have been an operator. Remove them from expression stack. while stack and stack[-1] == '<': stack.pop() if not stack: return (-1, None) if ((stack[-1] == '(' and char == ')') or (stack[-1] == '[' and char == ']') or (stack[-1] == '{' and char == '}')): stack.pop() if not stack: return (i + 1, None) else: # Mismatched parentheses return (-1, None) elif char == '>': # Found potential end of template argument list. # Ignore "->" and operator functions if (i > 0 and (line[i - 1] == '-' or Search(r'\boperator\s*$', line[0:i - 1]))): continue # Pop the stack if there is a matching '<'. Otherwise, ignore # this '>' since it must be an operator. if stack: if stack[-1] == '<': stack.pop() if not stack: return (i + 1, None) elif char == ';': # Found something that look like end of statements. If we are currently # expecting a '>', the matching '<' must have been an operator, since # template argument list should not contain statements. while stack and stack[-1] == '<': stack.pop() if not stack: return (-1, None) # Did not find end of expression or unbalanced parentheses on this line return (-1, stack) def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time matching parentheses. Ideally we would want to index all opening and closing parentheses once and have CloseExpression be just a simple lookup, but due to preprocessor tricks, this is not so easy. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: A position on the line. Returns: A tuple (line, linenum, pos) pointer *past* the closing brace, or (line, len(lines), -1) if we never find a close. Note we ignore strings and comments when matching; and the line we return is the 'cleansed' line at linenum. """ line = clean_lines.elided[linenum] if (line[pos] not in '({[<') or Match(r'<[<=]', line[pos:]): return (line, clean_lines.NumLines(), -1) # Check first line (end_pos, stack) = FindEndOfExpressionInLine(line, pos, []) if end_pos > -1: return (line, linenum, end_pos) # Continue scanning forward while stack and linenum < clean_lines.NumLines() - 1: linenum += 1 line = clean_lines.elided[linenum] (end_pos, stack) = FindEndOfExpressionInLine(line, 0, stack) if end_pos > -1: return (line, linenum, end_pos) # Did not find end of expression before end of file, give up return (line, clean_lines.NumLines(), -1) def FindStartOfExpressionInLine(line, endpos, stack): """Find position at the matching start of current expression. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at this position. stack: nesting stack at endpos. Returns: On finding matching start: (index at matching start, None) On finding an unclosed expression: (-1, None) Otherwise: (-1, new stack at beginning of this line) """ i = endpos while i >= 0: char = line[i] if char in ')]}': # Found end of expression, push to expression stack stack.append(char) elif char == '>': # Found potential end of template argument list. # # Ignore it if it's a "->" or ">=" or "operator>" if (i > 0 and (line[i - 1] == '-' or Match(r'\s>=\s', line[i - 1:]) or Search(r'\boperator\s*$', line[0:i]))): i -= 1 else: stack.append('>') elif char == '<': # Found potential start of template argument list if i > 0 and line[i - 1] == '<': # Left shift operator i -= 1 else: # If there is a matching '>', we can pop the expression stack. # Otherwise, ignore this '<' since it must be an operator. if stack and stack[-1] == '>': stack.pop() if not stack: return (i, None) elif char in '([{': # Found start of expression. # # If there are any unmatched '>' on the stack, they must be # operators. Remove those. while stack and stack[-1] == '>': stack.pop() if not stack: return (-1, None) if ((char == '(' and stack[-1] == ')') or (char == '[' and stack[-1] == ']') or (char == '{' and stack[-1] == '}')): stack.pop() if not stack: return (i, None) else: # Mismatched parentheses return (-1, None) elif char == ';': # Found something that look like end of statements. If we are currently # expecting a '<', the matching '>' must have been an operator, since # template argument list should not contain statements. while stack and stack[-1] == '>': stack.pop() if not stack: return (-1, None) i -= 1 return (-1, stack) def ReverseCloseExpression(clean_lines, linenum, pos): """If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: A position on the line. Returns: A tuple (line, linenum, pos) pointer *at* the opening brace, or (line, 0, -1) if we never find the matching opening brace. Note we ignore strings and comments when matching; and the line we return is the 'cleansed' line at linenum. """ line = clean_lines.elided[linenum] if line[pos] not in ')}]>': return (line, 0, -1) # Check last line (start_pos, stack) = FindStartOfExpressionInLine(line, pos, []) if start_pos > -1: return (line, linenum, start_pos) # Continue scanning backward while stack and linenum > 0: linenum -= 1 line = clean_lines.elided[linenum] (start_pos, stack) = FindStartOfExpressionInLine(line, len(line) - 1, stack) if start_pos > -1: return (line, linenum, start_pos) # Did not find start of expression before beginning of file, give up return (line, 0, -1) def CheckForCopyright(filename, lines, error): """Logs an error if no Copyright message appears at the top of the file.""" # We'll say it should occur by line 10. Don't forget there's a # placeholder line at the front. for line in xrange(1, min(len(lines), 11)): if re.search(r'Copyright', lines[line], re.I): break else: # means no copyright line was found error(filename, 0, 'legal/copyright', 5, 'No copyright message found. ' 'You should have a line: "Copyright [year] "') def GetIndentLevel(line): """Return the number of leading spaces in line. Args: line: A string to check. Returns: An integer count of leading spaces, possibly zero. """ indent = Match(r'^( *)\S', line) if indent: return len(indent.group(1)) 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. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is invoked from Emacs's # flymake. filename = re.sub(r'_flymake\.h$', '.h', 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() 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() # adapt slashes for windows root_abspath = os.path.abspath(_root).replace('\\', '/') 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() + '_' def CheckForHeaderGuard(filename, clean_lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance containing the file. error: The function to call with any errors found. """ # Don't check for header guards if there are error suppression # comments somewhere in this file. # # Because this is silencing a warning for a nonexistent line, we # only support the very specific NOLINT(build/header_guard) syntax, # and not the general NOLINT or NOLINT(*) syntax. raw_lines = clean_lines.lines_without_raw_strings for i in raw_lines: 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 = '' ifndef_linenum = 0 define = '' endif = '' endif_linenum = 0 for linenum, line in enumerate(raw_lines): linesplit = line.split() if len(linesplit) >= 2: # find the first occurrence of #ifndef and #define, save arg if not ifndef and linesplit[0] == '#ifndef': # set ifndef to the header guard presented on the #ifndef line. ifndef = linesplit[1] ifndef_linenum = linenum if not define and linesplit[0] == '#define': define = linesplit[1] # find the last occurrence of #endif, save entire line if line.startswith('#endif'): endif = line endif_linenum = linenum if not ifndef or not define or ifndef != define: error(filename, 0, 'build/header_guard', 5, 'No #ifndef header guard found, suggested CPP variable is: %s' % cppvar) return # The guard should be PATH_FILE_H_, but we also allow PATH_FILE_H__ # for backward compatibility. if ifndef != cppvar: error_level = 0 if ifndef != cppvar + '_': error_level = 5 ParseNolintSuppressions(filename, raw_lines[ifndef_linenum], ifndef_linenum, error) error(filename, ifndef_linenum, 'build/header_guard', error_level, '#ifndef header guard has wrong style, please use: %s' % cppvar) # Check for "//" comments on endif line. ParseNolintSuppressions(filename, raw_lines[endif_linenum], endif_linenum, error) match = Match(r'#endif\s*//\s*' + cppvar + r'(_)?\b', endif) if match: if match.group(1) == '_': # Issue low severity warning for deprecated double trailing underscore error(filename, endif_linenum, 'build/header_guard', 0, '#endif line should be "#endif // %s"' % cppvar) return # Didn't find the corresponding "//" comment. If this file does not # contain any "//" comments at all, it could be that the compiler # only wants "/**/" comments, look for those instead. no_single_line_comments = True for i in xrange(1, len(raw_lines) - 1): line = raw_lines[i] if Match(r'^(?:(?:\'(?:\.|[^\'])*\')|(?:"(?:\.|[^"])*")|[^\'"])*//', line): no_single_line_comments = False break if no_single_line_comments: match = Match(r'#endif\s*/\*\s*' + cppvar + r'(_)?\s*\*/', endif) if match: if match.group(1) == '_': # Low severity warning for double trailing underscore error(filename, endif_linenum, 'build/header_guard', 0, '#endif line should be "#endif /* %s */"' % cppvar) return # Didn't find anything error(filename, endif_linenum, 'build/header_guard', 5, '#endif line should be "#endif // %s"' % cppvar) def CheckHeaderFileIncluded(filename, include_state, error): """Logs an error if a source file does not include its header.""" # Do not check test files fileinfo = FileInfo(filename) if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()): return 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 include_uses_unix_dir_aliases = False for section_list in include_state.include_list: for f in section_list: include_text = f[0] if "./" in include_text: include_uses_unix_dir_aliases = True if headername in include_text or include_text in headername: return if not first_include: first_include = f[1] message = '%s should include its header file %s' % (fileinfo.RepositoryName(), headername) if include_uses_unix_dir_aliases: message += ". Relative paths like . and .. are not allowed." error(filename, first_include, 'build/include', 5, message) def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if the invalid UTF-8 occurred adjacent to a newline. 2. NUL bytes. These are problematic for some tools. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ for linenum, line in enumerate(lines): 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: error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.') def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array lines() was created by adding two newlines to the # original file (go figure), then splitting on \n. # To verify that the file ends in \n, we just have to make sure the # last-but-two element of lines() exists and is empty. if len(lines) < 3 or lines[-2]: error(filename, len(lines) - 2, 'whitespace/ending_newline', 5, 'Could not find a newline character at the end of the file.') def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): """Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings to extend across multiple lines, as long as a line continuation character (backslash) terminates each line. Although not currently prohibited by the C++ style guide, it's ugly and unnecessary. We don't do well with either in this lint program, so we warn about both. 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] # Remove all \\ (escaped backslashes) from the line. They are OK, and the # second (escaped) slash may trigger later \" detection erroneously. line = line.replace('\\\\', '') if line.count('/*') > line.count('*/'): error(filename, linenum, 'readability/multiline_comment', 5, 'Complex multi-line /*...*/-style comment found. ' 'Lint may give bogus warnings. ' 'Consider replacing these with //-style comments, ' 'with #if 0...#endif, ' 'or with more clearly structured multi-line comments.') if (line.count('"') - line.count('\\"')) % 2: error(filename, linenum, 'readability/multiline_string', 5, 'Multi-line string ("...") found. This lint script doesn\'t ' 'do well with such strings, and may give bogus warnings. ' 'Use C++11 raw strings or concatenation instead.') # (non-threadsafe name, thread-safe alternative, validation pattern) # # The validation pattern is used to eliminate false positives such as: # _rand(); // false positive due to substring match. # ->rand(); // some member function rand(). # ACMRandom rand(seed); // some variable named rand. # ISAACRandom rand(); // another variable named rand. # # Basically we require the return value of these functions to be used # in some expression context on the same line by matching on some # operator before the function name. This eliminates constructors and # member function calls. _UNSAFE_FUNC_PREFIX = r'(?:[-+*/=%^&|(<]\s*|>\s+)' _THREADING_LIST = ( ('asctime(', 'asctime_r(', _UNSAFE_FUNC_PREFIX + r'asctime\([^)]+\)'), ('ctime(', 'ctime_r(', _UNSAFE_FUNC_PREFIX + r'ctime\([^)]+\)'), ('getgrgid(', 'getgrgid_r(', _UNSAFE_FUNC_PREFIX + r'getgrgid\([^)]+\)'), ('getgrnam(', 'getgrnam_r(', _UNSAFE_FUNC_PREFIX + r'getgrnam\([^)]+\)'), ('getlogin(', 'getlogin_r(', _UNSAFE_FUNC_PREFIX + r'getlogin\(\)'), ('getpwnam(', 'getpwnam_r(', _UNSAFE_FUNC_PREFIX + r'getpwnam\([^)]+\)'), ('getpwuid(', 'getpwuid_r(', _UNSAFE_FUNC_PREFIX + r'getpwuid\([^)]+\)'), ('gmtime(', 'gmtime_r(', _UNSAFE_FUNC_PREFIX + r'gmtime\([^)]+\)'), ('localtime(', 'localtime_r(', _UNSAFE_FUNC_PREFIX + r'localtime\([^)]+\)'), ('rand(', 'rand_r(', _UNSAFE_FUNC_PREFIX + r'rand\(\)'), ('strtok(', 'strtok_r(', _UNSAFE_FUNC_PREFIX + r'strtok\([^)]+\)'), ('ttyname(', 'ttyname_r(', _UNSAFE_FUNC_PREFIX + r'ttyname\([^)]+\)'), ) def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when using posix directly). 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] for single_thread_func, multithread_safe_func, pattern in _THREADING_LIST: # Additional pattern matching check to confirm that this is the # function we are looking for if Search(pattern, line): error(filename, linenum, 'runtime/threadsafe_fn', 2, 'Consider using ' + multithread_safe_func + '...) instead of ' + single_thread_func + '...) for improved thread safety.') def CheckVlogArguments(filename, clean_lines, linenum, error): """Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. 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] if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line): error(filename, linenum, 'runtime/vlog', 5, 'VLOG() should be used with numeric verbosity level. ' 'Use LOG() if you want symbolic severity levels.') # Matches invalid increment: *count++, which moves pointer instead of # incrementing a value. _RE_PATTERN_INVALID_INCREMENT = re.compile( r'^\s*\*\w+(\+\+|--);') def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. 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] if _RE_PATTERN_INVALID_INCREMENT.match(line): error(filename, linenum, 'runtime/invalid_increment', 5, 'Changing pointer instead of value (or unused value of operator*).') def IsMacroDefinition(clean_lines, linenum): if Search(r'^#define', clean_lines[linenum]): return True if linenum > 0 and Search(r'\\$', clean_lines[linenum - 1]): return True return False def IsForwardClassDeclaration(clean_lines, linenum): return Match(r'^\s*(\btemplate\b)*.*class\s+\w+;\s*$', clean_lines[linenum]) class _BlockInfo(object): """Stores information about a generic block of code.""" 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 self.check_namespace_indentation = False def CheckBegin(self, filename, clean_lines, linenum, error): """Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pass. 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. """ pass def CheckEnd(self, filename, clean_lines, linenum, error): """Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. 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. """ pass def IsBlockInfo(self): """Returns true if this block is a _BlockInfo. This is convenient for verifying that an object is an instance of a _BlockInfo, but not an instance of any of the derived classes. Returns: True for this class, False for derived classes. """ return self.__class__ == _BlockInfo class _ExternCInfo(_BlockInfo): """Stores information about an 'extern "C"' block.""" 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, linenum, False) self.name = name self.is_derived = False self.check_namespace_indentation = True if class_or_struct == 'struct': self.access = 'public' self.is_struct = True else: self.access = 'private' self.is_struct = False # Remember initial indentation level for this class. Using raw_lines here # instead of elided to account for leading comments. self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum]) # Try to find the end of the class. This will be confused by things like: # class A { # } *x = { ... # # But it's still good enough for CheckSectionSpacing. self.last_line = 0 depth = 0 for i in range(linenum, clean_lines.NumLines()): line = clean_lines.elided[i] depth += line.count('{') - line.count('}') if not depth: self.last_line = i break def CheckBegin(self, filename, clean_lines, linenum, error): # Look for a bare ':' if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]): self.is_derived = True def CheckEnd(self, filename, clean_lines, linenum, error): # If there is a DISALLOW macro, it should appear near the end of # the class. seen_last_thing_in_class = False for i in xrange(linenum - 1, self.starting_linenum, -1): match = Search( r'\b(DISALLOW_COPY_AND_ASSIGN|DISALLOW_IMPLICIT_CONSTRUCTORS)\(' + self.name + r'\)', clean_lines.elided[i]) if match: if seen_last_thing_in_class: error(filename, i, 'readability/constructors', 3, match.group(1) + ' should be the last thing in the class') break if not Match(r'^\s*$', clean_lines.elided[i]): seen_last_thing_in_class = True # Check that closing brace is aligned with beginning of the class. # Only do this if the closing brace is indented by only whitespaces. # This means we will not check single-line class definitions. indent = Match(r'^( *)\}', clean_lines.elided[linenum]) if indent and len(indent.group(1)) != self.class_indent: if self.is_struct: parent = 'struct ' + self.name else: parent = 'class ' + self.name error(filename, linenum, 'whitespace/indent', 3, 'Closing brace should be aligned with beginning of %s' % parent) class _NamespaceInfo(_BlockInfo): """Stores information about a namespace.""" def __init__(self, name, linenum): _BlockInfo.__init__(self, linenum, False) self.name = name or '' self.check_namespace_indentation = True def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply checks if there is already an end of # namespace comment and it's incorrect. # # TODO(unknown): We always want to check end of namespace comments # if a namespace is large, but sometimes we also want to apply the # check if a short namespace contained nontrivial things (something # other than forward declarations). There is currently no logic on # 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*};*\s*(//|/\*).*\bnamespace\b', line)): return # Look for matching comment at end of namespace. # # Note that we accept C style "/* */" comments for terminating # namespaces, so that code that terminate namespaces inside # preprocessor macros can be cpplint clean. # # We also accept stuff like "// end of namespace ." with the # period at the end. # # Besides these, we don't accept anything else, otherwise we might # get false negatives when existing comment is a substring of the # expected namespace. if self.name: # Named namespace 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*};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line): # If "// namespace anonymous" or "// anonymous namespace (more text)", # mention "// anonymous namespace" as an acceptable form 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"') else: error(filename, linenum, 'readability/namespace', 5, 'Anonymous namespace should be terminated with "// namespace"') class _PreprocessorInfo(object): """Stores checkpoints of nesting stacks when #if/#else is seen.""" def __init__(self, stack_before_if): # The entire nesting stack before #if self.stack_before_if = stack_before_if # The entire nesting stack up to #else self.stack_before_else = [] # Whether we have already seen #else or #elif self.seen_else = False class NestingState(object): """Holds states related to parsing braces.""" def __init__(self): # Stack for tracking all braces. An object is pushed whenever we # see a "{", and popped when we see a "}". Only 3 types of # objects are possible: # - _ClassInfo: a class or struct. # - _NamespaceInfo: a namespace. # - _BlockInfo: some other type of block. self.stack = [] # Top of the previous stack before each Update(). # # Because the nesting_stack is updated at the end of each line, we # had to do some convoluted checks to find out what is the current # scope at the beginning of the line. This check is simplified by # saving the previous top of nesting stack. # # We could save the full stack, but we only need the top. Copying # the full nesting stack would slow down cpplint by ~10%. self.previous_stack_top = [] # Stack of _PreprocessorInfo objects. self.pp_stack = [] def SeenOpenBrace(self): """Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace. """ return (not self.stack) or self.stack[-1].seen_open_brace def InNamespaceBody(self): """Check if we are currently one level inside a namespace body. Returns: True if top of the stack is a namespace block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _NamespaceInfo) def InExternC(self): """Check if we are currently one level inside an 'extern "C"' block. Returns: True if top of the stack is an extern block, False otherwise. """ return self.stack and isinstance(self.stack[-1], _ExternCInfo) def InClassDeclaration(self): """Check if we are currently one level inside a class or struct declaration. Returns: True if top of the stack is a class/struct, False otherwise. """ return self.stack and isinstance(self.stack[-1], _ClassInfo) def InAsmBlock(self): """Check if we are currently one level inside an inline ASM block. Returns: True if the top of the stack is a block containing inline ASM. """ return self.stack and self.stack[-1].inline_asm != _NO_ASM def InTemplateArgumentList(self, clean_lines, linenum, pos): """Check if current position is inside template argument list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: position just after the suspected template argument. Returns: True if (linenum, pos) is inside template arguments. """ while linenum < clean_lines.NumLines(): # Find the earliest character that might indicate a template argument line = clean_lines.elided[linenum] match = Match(r'^[^{};=\[\]\.<>]*(.)', line[pos:]) if not match: linenum += 1 pos = 0 continue token = match.group(1) pos += len(match.group(0)) # These things do not look like template argument list: # class Suspect { # class Suspect x; } if token in ('{', '}', ';'): return False # These things look like template argument list: # template # template # template # template if token in ('>', '=', '[', ']', '.'): return True # Check if token is an unmatched '<'. # If not, move on to the next character. if token != '<': pos += 1 if pos >= len(line): linenum += 1 pos = 0 continue # We can't be sure if we just find a single '<', and need to # find the matching '>'. (_, end_line, end_pos) = CloseExpression(clean_lines, linenum, pos - 1) if end_pos < 0: # Not sure if template argument list or syntax error in file return False linenum = end_line pos = end_pos return False def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most files): - Preprocessor condition evaluates to true from #if up to first #else/#elif/#endif. - Preprocessor condition evaluates to false from #else/#elif up to #endif. We still perform lint checks on these lines, but these do not affect nesting stack. Args: line: current line to check. """ if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', line): # Beginning of #if block, save the nesting stack here. The saved # stack will allow us to restore the parsing state in the #else case. self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack))) elif Match(r'^\s*#\s*(else|elif)\b', line): # Beginning of #else block if self.pp_stack: if not self.pp_stack[-1].seen_else: # This is the first #else or #elif block. Remember the # whole nesting stack up to this point. This is what we # keep after the #endif. self.pp_stack[-1].seen_else = True self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack) # Restore the stack to how it was before the #if self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if) else: # TODO(unknown): unexpected #else, issue warning? pass elif Match(r'^\s*#\s*endif\b', line): # End of #if or #else blocks. if self.pp_stack: # If we saw an #else, we will need to restore the nesting # stack to its former state before the #else, otherwise we # will just continue from where we left off. if self.pp_stack[-1].seen_else: # Here we can just use a shallow copy since we are the last # reference to it. self.stack = self.pp_stack[-1].stack_before_else # Drop the corresponding #if self.pp_stack.pop() else: # TODO(unknown): unexpected #endif, issue warning? pass # TODO(unknown): Update() is too long, but we will refactor later. def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. 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] # Remember top of the previous nesting stack. # # The stack is always pushed/popped and not modified in place, so # we can just do a shallow copy instead of copy.deepcopy. Using # deepcopy would slow down cpplint by ~28%. if self.stack: self.previous_stack_top = self.stack[-1] else: self.previous_stack_top = None # Update pp_stack self.UpdatePreprocessor(line) # Count parentheses. This is to avoid adding struct arguments to # the nesting stack. if self.stack: inner_block = self.stack[-1] depth_change = line.count('(') - line.count(')') inner_block.open_parentheses += depth_change # Also check if we are starting or ending an inline assembly block. if inner_block.inline_asm in (_NO_ASM, _END_ASM): if (depth_change != 0 and inner_block.open_parentheses == 1 and _MATCH_ASM.match(line)): # Enter assembly block inner_block.inline_asm = _INSIDE_ASM else: # Not entering assembly block. If previous line was _END_ASM, # we will now shift to _NO_ASM state. inner_block.inline_asm = _NO_ASM elif (inner_block.inline_asm == _INSIDE_ASM and inner_block.open_parentheses == 0): # Exit assembly block inner_block.inline_asm = _END_ASM # Consume namespace declaration at the beginning of the line. Do # this in a loop so that we catch same line declarations like this: # namespace proto2 { namespace bridge { class MessageSet; } } while True: # Match start of namespace. The "\b\s*" below catches namespace # declarations even if it weren't followed by a whitespace, this # is so that we don't confuse our namespace checker. The # missing spaces will be flagged by CheckSpacing. namespace_decl_match = Match(r'^\s*namespace\b\s*([:\w]+)?(.*)$', line) if not namespace_decl_match: break new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum) self.stack.append(new_namespace) line = namespace_decl_match.group(2) if line.find('{') != -1: new_namespace.seen_open_brace = True line = line[line.find('{') + 1:] # Look for a class declaration in whatever is left of the line # after parsing namespaces. The regexp accounts for decorated classes # such as in: # class LOCKABLE API Object { # }; class_decl_match = Match( r'^(\s*(?:template\s*<[\w\s<>,:=]*>\s*)?' r'(class|struct)\s+(?:[a-zA-Z0-9_]+\s+)*(\w+(?:::\w+)*))' r'(.*)$', line) if (class_decl_match and (not self.stack or self.stack[-1].open_parentheses == 0)): # We do not want to accept classes that are actually template arguments: # template , # template class Ignore3> # void Function() {}; # # To avoid template argument cases, we scan forward and look for # an unmatched '>'. If we see one, assume we are inside a # template argument list. end_declaration = len(class_decl_match.group(1)) if not self.InTemplateArgumentList(clean_lines, linenum, end_declaration): self.stack.append(_ClassInfo( class_decl_match.group(3), class_decl_match.group(2), clean_lines, linenum)) line = class_decl_match.group(4) # If we have not yet seen the opening brace for the innermost block, # run checks here. if not self.SeenOpenBrace(): self.stack[-1].CheckBegin(filename, clean_lines, linenum, error) # Update access control if we are inside a class/struct if self.stack and isinstance(self.stack[-1], _ClassInfo): classinfo = self.stack[-1] access_match = Match( r'^(.*)\b(public|private|protected|signals)(\s+(?:slots\s*)?)?' r':(?:[^:]|$)', line) if access_match: classinfo.access = access_match.group(2) # Check that access keywords are indented +1 space. Skip this # check if the keywords are not preceded by whitespaces. indent = access_match.group(1) if (len(indent) != classinfo.class_indent + 1 and Match(r'^\s*$', indent)): if classinfo.is_struct: parent = 'struct ' + classinfo.name else: parent = 'class ' + classinfo.name slots = '' if access_match.group(3): slots = access_match.group(3) error(filename, linenum, 'whitespace/indent', 3, '%s%s: should be indented +1 space inside %s' % ( access_match.group(2), slots, parent)) # Consume braces or semicolons from what's left of the line while True: # Match first brace, semicolon, or closed parenthesis. matched = Match(r'^[^{;)}]*([{;)}])(.*)$', line) if not matched: break token = matched.group(1) if token == '{': # If namespace or class hasn't seen a opening brace yet, mark # namespace/class head as complete. Push a new block onto the # stack otherwise. if not self.SeenOpenBrace(): self.stack[-1].seen_open_brace = True elif Match(r'^extern\s*"[^"]*"\s*\{', line): self.stack.append(_ExternCInfo(linenum)) else: self.stack.append(_BlockInfo(linenum, True)) if _MATCH_ASM.match(line): self.stack[-1].inline_asm = _BLOCK_ASM elif token == ';' or token == ')': # If we haven't seen an opening brace yet, but we already saw # a semicolon, this is probably a forward declaration. Pop # the stack for these. # # Similarly, if we haven't seen an opening brace yet, but we # already saw a closing parenthesis, then these are probably # function arguments with extra "class" or "struct" keywords. # Also pop these stack for these. if not self.SeenOpenBrace(): self.stack.pop() else: # token == '}' # Perform end of block checks and pop the stack. if self.stack: self.stack[-1].CheckEnd(filename, clean_lines, linenum, error) self.stack.pop() line = matched.group(2) def InnermostClass(self): """Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise. """ for i in range(len(self.stack), 0, -1): classinfo = self.stack[i - 1] if isinstance(classinfo, _ClassInfo): return classinfo return None def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: This test can result in false positives if #ifdef constructs # get in the way of brace matching. See the testBuildClass test in # cpplint_unittest.py for an example of this. for obj in self.stack: if isinstance(obj, _ClassInfo): error(filename, obj.starting_linenum, 'build/class', 5, 'Failed to find complete declaration of class %s' % obj.name) elif isinstance(obj, _NamespaceInfo): error(filename, obj.starting_linenum, 'build/namespaces', 5, 'Failed to find complete declaration of namespace %s' % obj.name) def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const static"). - "%lld" instead of %qd" in printf-type functions. - "%1$d" is non-standard in printf-type functions. - "\%" is an undefined character escape sequence. - text after #endif is not allowed. - invalid inner-style forward declaration. - >? and ?= and )\?=?\s*(\w+|[+-]?\d+)(\.\d*)?', line): error(filename, linenum, 'build/deprecated', 3, '>? and ))?' # r'\s*const\s*' + type_name + '\s*&\s*\w+\s*;' error(filename, linenum, 'runtime/member_string_references', 2, 'const string& members are dangerous. It is much better to use ' 'alternatives, such as pointers or simple constants.') # Everything else in this function operates on class declarations. # Return early if the top of the nesting stack is not a class, or if # the class head is not completed yet. classinfo = nesting_state.InnermostClass() if not classinfo or not classinfo.seen_open_brace: return # The class may have been declared with namespace or classname qualifiers. # The constructor and destructor will not have those qualifiers. base_classname = classinfo.name.split('::')[-1] # Look for single-argument constructors that aren't marked explicit. # Technically a valid construct, but against style. explicit_constructor_match = Match( r'\s+(?:(?:inline|constexpr)\s+)*(explicit\s+)?' r'(?:(?:inline|constexpr)\s+)*%s\s*' r'\(((?:[^()]|\([^()]*\))*)\)' % re.escape(base_classname), line) if explicit_constructor_match: is_marked_explicit = explicit_constructor_match.group(1) if not explicit_constructor_match.group(2): constructor_args = [] else: constructor_args = explicit_constructor_match.group(2).split(',') # collapse arguments so that commas in template parameter lists and function # argument parameter lists don't split arguments in two i = 0 while i < len(constructor_args): constructor_arg = constructor_args[i] while (constructor_arg.count('<') > constructor_arg.count('>') or constructor_arg.count('(') > constructor_arg.count(')')): constructor_arg += ',' + constructor_args[i + 1] del constructor_args[i + 1] 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 (len(constructor_args) == 1 and constructor_args[0].strip() == 'void')) onearg_constructor = ((len(constructor_args) == 1 and # exactly one arg not noarg_constructor) or # all but at most one arg defaulted (len(constructor_args) >= 1 and not noarg_constructor and 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+(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 or variadic_args: error(filename, linenum, 'runtime/explicit', 5, 'Constructors callable with one argument ' 'should be marked explicit.') else: error(filename, linenum, 'runtime/explicit', 5, 'Single-parameter constructors should be marked explicit.') elif is_marked_explicit and not onearg_constructor: if noarg_constructor: error(filename, linenum, 'runtime/explicit', 5, 'Zero-parameter constructors should not be marked explicit.') def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): """Checks for the correctness of various spacing around function calls. 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] # Since function calls often occur inside if/for/while/switch # expressions - which have their own, more liberal conventions - we # first see if we should be looking inside such an expression for a # function call, to which we can apply more strict standards. fncall = line # if there's no control flow construct, look at whole line for pattern in (r'\bif\s*\((.*)\)\s*{', r'\bfor\s*\((.*)\)\s*{', r'\bwhile\s*\((.*)\)\s*[{;]', r'\bswitch\s*\((.*)\)\s*{'): match = Search(pattern, line) if match: fncall = match.group(1) # look inside the parens for function calls break # Except in if/for/while/switch, there should never be space # immediately inside parens (eg "f( 3, 4 )"). We make an exception # for nested parens ( (a+b) + c ). Likewise, there should never be # a space before a ( when it's a function argument. I assume it's a # function argument when the char before the whitespace is legal in # a function name (alnum + _) and we're not starting a macro. Also ignore # pointers and references to arrays and functions coz they're too tricky: # we use a very simple way to recognize these: # " (something)(maybe-something)" or # " (something)(maybe-something," or # " (something)[something]" # Note that we assume the contents of [] to be short enough that # they'll never need to wrap. if ( # Ignore control structures. not Search(r'\b(if|elif|for|while|switch|return|new|delete|catch|sizeof)\b', fncall) and # Ignore pointers/references to functions. not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and # Ignore pointers/references to arrays. not Search(r' \([^)]+\)\[[^\]]+\]', fncall)): if Search(r'\w\s*\(\s(?!\s*\\$)', fncall): # a ( used for a fn call error(filename, linenum, 'whitespace/parens', 4, 'Extra space after ( in function call') elif Search(r'\(\s+(?!(\s*\\)|\()', fncall): 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)): # TODO(unknown): Space after an operator function seem to be a common # error, silence those for now by restricting them to highest verbosity. if Search(r'\boperator_*\b', line): error(filename, linenum, 'whitespace/parens', 0, 'Extra space before ( in function call') else: error(filename, linenum, 'whitespace/parens', 4, 'Extra space before ( in function call') # If the ) is followed only by a newline or a { + newline, assume it's # part of a control statement (if/while/etc), and don't complain if Search(r'[^)]\s+\)\s*[^{\s]', fncall): # If the closing parenthesis is preceded by only whitespaces, # try to give a more descriptive error message. if Search(r'^\s+\)', fncall): error(filename, linenum, 'whitespace/parens', 2, 'Closing ) should be moved to the previous line') else: error(filename, linenum, 'whitespace/parens', 2, 'Extra space before )') def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace() def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, error): is_namespace_indent_item = ( len(nesting_state.stack) > 1 and nesting_state.stack[-1].check_namespace_indentation and isinstance(nesting_state.previous_stack_top, _NamespaceInfo) and nesting_state.previous_stack_top == nesting_state.stack[-2]) if ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, clean_lines.elided, line): CheckItemIndentationInNamespace(filename, clean_lines.elided, line, error) def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error): """Reports for long function bodies. For an overview why this is done, see: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. Only checks unindented functions, so class members are unchecked. Trivial bodies are unchecked, so constructors with huge initializer lists may be missed. Blank/comment lines are not counted so as to avoid encouraging the removal of vertical space and comments just to get through a lint check. NOLINT *on the last line of a function* disables this check. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. function_state: Current function name and lines in body so far. error: The function to call with any errors found. """ lines = clean_lines.lines line = lines[linenum] joined_line = '' starting_func = False regexp = r'(\w(\w|::|\*|\&|\s)*)\(' # decls * & space::name( ... match_result = Match(regexp, line) if match_result: # If the name is all caps and underscores, figure it's a macro and # ignore it, unless it's TEST or TEST_F. function_name = match_result.group(1).split()[-1] if function_name == 'TEST' or function_name == 'TEST_F' or ( not Match(r'[A-Z_]+$', function_name)): starting_func = True if starting_func: body_found = False for start_linenum in xrange(linenum, clean_lines.NumLines()): start_line = lines[start_linenum] joined_line += ' ' + start_line.lstrip() if Search(r'(;|})', start_line): # Declarations and trivial functions body_found = True break # ... ignore if Search(r'{', start_line): body_found = True function = Search(r'((\w|:)*)\(', line).group(1) if Match(r'TEST', function): # Handle TEST... macros parameter_regexp = Search(r'(\(.*\))', joined_line) if parameter_regexp: # Ignore bad syntax function += parameter_regexp.group(1) else: function += '()' function_state.Begin(function) break if not body_found: # No body for the function (or evidence of a non-function) was found. error(filename, linenum, 'readability/fn_size', 5, 'Lint failed to find start of function body.') elif Match(r'^\}\s*$', line): # function end function_state.Check(error, filename, linenum) function_state.End() elif not Match(r'^\s*$', line): function_state.Count() # Count non-blank/non-comment lines. _RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?') def CheckComment(line, filename, linenum, next_line_start, error): """Checks for common mistakes in comments. Args: line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. error: The function to call with any errors found. """ commentpos = line.find('//') if commentpos != -1: # Check if the // may be in quotes. If so, ignore it 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 line[commentpos-1] not in string.whitespace) or (commentpos >= 2 and line[commentpos-2] not in string.whitespace))): error(filename, linenum, 'whitespace/comments', 2, 'At least two spaces is best between code and comments') # Checks for common mistakes in TODO comments. comment = line[commentpos:] match = _RE_PATTERN_TODO.match(comment) if match: # One whitespace is correct; zero whitespace is handled elsewhere. leading_whitespace = match.group(1) if len(leading_whitespace) > 1: error(filename, linenum, 'whitespace/todo', 2, 'Too many spaces before TODO') username = match.group(2) if not username: error(filename, linenum, 'readability/todo', 2, 'Missing username in TODO; it should look like ' '"// TODO(my_username): Stuff."') middle_whitespace = match.group(3) # Comparisons made explicit for correctness -- pylint: disable=g-explicit-bool-comparison if middle_whitespace != ' ' and middle_whitespace != '': error(filename, linenum, 'whitespace/todo', 2, 'TODO(my_username) should be followed by a space') # If the comment contains an alphanumeric character, there # should be a space somewhere between it and the // unless # it's a /// or //! Doxygen comment. if (Match(r'//[^ ]*\w', comment) and not Match(r'(///|//\!)(\s+|$)', comment)): error(filename, linenum, 'whitespace/comments', 4, 'Should have a space between // and comment') def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't add a blank line after public/protected/private, don't have too many blank lines in a row. 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. """ # Don't use "elided" lines here, otherwise we can't check commented lines. # Don't want to use "raw" either, because we don't want to check inside C++11 # raw strings, raw = clean_lines.lines_without_raw_strings line = raw[linenum] # Before nixing comments, check if the line is blank for no good # reason. This includes the first line after a block is opened, and # blank lines at the end of a function (ie, right before a line like '}' # # Skip all the blank line checks if we are immediately inside a # namespace body. In other words, don't issue blank line warnings # for this block: # namespace { # # } # # A warning about missing end of namespace comments will be issued instead. # # Also skip blank line checks for 'extern "C"' blocks, which are formatted # like namespaces. if (IsBlankLine(line) and not nesting_state.InNamespaceBody() and not nesting_state.InExternC()): elided = clean_lines.elided prev_line = elided[linenum - 1] prevbrace = prev_line.rfind('{') # TODO(unknown): Don't complain if line before blank line, and line after, # both start with alnums and are indented the same amount. # This ignores whitespace at the start of a namespace block # because those are not usually indented. if prevbrace != -1 and prev_line[prevbrace:].find('}') == -1: # OK, we have a blank line at the start of a code block. Before we # complain, we check if it is an exception to the rule: The previous # non-empty line has the parameters of a function header that are indented # 4 spaces (because they did not fit in a 80 column line when placed on # the same line as the function name). We also check for the case where # the previous line is indented 6 spaces, which may happen when the # initializers of a constructor do not fit into a 80 column line. exception = False if Match(r' {6}\w', prev_line): # Initializer list? # We are looking for the opening column of initializer list, which # should be indented 4 spaces to cause 6 space indentation afterwards. search_position = linenum-2 while (search_position >= 0 and Match(r' {6}\w', elided[search_position])): search_position -= 1 exception = (search_position >= 0 and elided[search_position][:5] == ' :') else: # Search for the function arguments or an initializer list. We use a # simple heuristic here: If the line is indented 4 spaces; and we have a # closing paren, without the opening paren, followed by an opening brace # or colon (for initializer lists) we assume that it is the last line of # a function header. If we have a colon indented 4 spaces, it is an # initializer list. exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)', prev_line) or Match(r' {4}:', prev_line)) if not exception: error(filename, linenum, 'whitespace/blank_line', 2, 'Redundant blank line at the start of a code block ' 'should be deleted.') # Ignore blank lines at the end of a block in a long if-else # chain, like this: # if (condition1) { # // Something followed by a blank line # # } else if (condition2) { # // Something else # } if linenum + 1 < clean_lines.NumLines(): next_line = raw[linenum + 1] if (next_line and Match(r'\s*}', next_line) and next_line.find('} else ') == -1): error(filename, linenum, 'whitespace/blank_line', 3, 'Redundant blank line at the end of a code block ' 'should be deleted.') matched = Match(r'\s*(public|protected|private):', prev_line) if matched: error(filename, linenum, 'whitespace/blank_line', 3, 'Do not leave a blank line after "%s:"' % matched.group(1)) # Next, check comments next_line_start = 0 if linenum + 1 < clean_lines.NumLines(): next_line = raw[linenum + 1] next_line_start = len(next_line) - len(next_line.lstrip()) CheckComment(line, filename, linenum, next_line_start, error) # get rid of comments and strings line = clean_lines.elided[linenum] # You shouldn't have spaces before your brackets, except for C++11 attributes # or maybe after '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 [') # In range-based for, we wanted spaces before and after the colon, but # not around "::" tokens that might appear. if (Search(r'for *\(.*[^:]:[^: ]', line) or Search(r'for *\(.*[^: ]:[^:]', line)): error(filename, linenum, 'whitespace/forcolon', 2, 'Missing space around colon in range-based for loop') def CheckOperatorSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around operators. 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] # Don't try to do spacing checks for operator methods. Do this by # replacing the troublesome characters with something else, # preserving column position for all other characters. # # The replacement is done repeatedly to avoid false positives from # operators that call operators. while True: match = Match(r'^(.*\boperator\b)(\S+)(\s*\(.*)$', line) if match: line = match.group(1) + ('_' * len(match.group(2))) + match.group(3) else: break # We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )". # Otherwise not. Note we only check for non-spaces on *both* sides; # sometimes people put non-spaces on one side when aligning ='s among # many lines (not that this is behavior that I approve of...) if ((Search(r'[\w.]=', line) or Search(r'=[\w.]', line)) and not Search(r'\b(if|while|for) ', line) # Operators taken from [lex.operators] in C++11 standard. and not Search(r'(>=|<=|==|!=|&=|\^=|\|=|\+=|\*=|\/=|\%=)', line) and not Search(r'operator=', line)): error(filename, linenum, 'whitespace/operators', 4, 'Missing spaces around =') # It's ok not to have spaces around binary operators like + - * /, but if # there's too little whitespace, we get concerned. It's hard to tell, # though, so we punt on this one for now. TODO. # You should always have whitespace around binary operators. # # Check <= and >= first to avoid false positives with < and >, then # check non-include lines for spacing around < and >. # # If the operator is followed by a comma, assume it's be used in a # macro context and don't do any checks. This avoids false # positives. # # 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, 'Missing spaces around %s' % match.group(1)) elif not Match(r'#.*include', line): # Look for < that is not surrounded by spaces. This is only # triggered if both sides are missing spaces, even though # technically should should flag if at least one side is missing a # space. This is done to avoid some false positives with shifts. match = Match(r'^(.*[^\s<])<[^\s=<,]', line) if match: (_, _, end_pos) = CloseExpression( clean_lines, linenum, len(match.group(1))) if end_pos <= -1: error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around <') # Look for > that is not surrounded by spaces. Similar to the # above, we only trigger if both sides are missing spaces to avoid # false positives with shifts. match = Match(r'^(.*[^-\s>])>[^\s=>,]', line) if match: (_, _, start_pos) = ReverseCloseExpression( clean_lines, linenum, len(match.group(1))) if start_pos <= -1: error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around >') # We allow no-spaces around << when used like this: 10<<20, but # not otherwise (particularly, not when used as streams) # # 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|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, 'Missing spaces around <<') # We allow no-spaces around >> for almost anything. This is because # C++11 allows ">>" to close nested templates, which accounts for # most cases when ">>" is not followed by a space. # # We still warn on ">>" followed by alpha character, because that is # likely due to ">>" being used for right shifts, e.g.: # value >> alpha # # When ">>" is used to close templates, the alphanumeric letter that # follows would be part of an identifier, and there should still be # a space separating the template type and the identifier. # type> alpha match = Search(r'>>[a-zA-Z_]', line) if match: error(filename, linenum, 'whitespace/operators', 3, 'Missing spaces around >>') # There shouldn't be space around unary operators match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line) if match: error(filename, linenum, 'whitespace/operators', 4, 'Extra space for operator %s' % match.group(1)) def CheckParenthesisSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around parentheses. 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] # No spaces after an if, while, switch, or for match = Search(r' (if\(|for\(|while\(|switch\()', line) if match: error(filename, linenum, 'whitespace/parens', 5, 'Missing space before ( in %s' % match.group(1)) # For if/for/while/switch, the left and right parens should be # consistent about how many spaces are inside the parens, and # there should either be zero or one spaces inside the parens. # We don't want: "if ( foo)" or "if ( foo )". # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed. match = Search(r'\b(if|for|while|switch)\s*' r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$', line) if match: if len(match.group(2)) != len(match.group(4)): if not (match.group(3) == ';' and len(match.group(2)) == 1 + len(match.group(4)) or not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)): error(filename, linenum, 'whitespace/parens', 5, 'Mismatching spaces inside () in %s' % match.group(1)) if len(match.group(2)) not in [0, 1]: error(filename, linenum, 'whitespace/parens', 5, 'Should have zero or one spaces inside ( and ) in %s' % match.group(1)) def CheckCommaSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing near commas and semicolons. 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. """ raw = clean_lines.lines_without_raw_strings line = clean_lines.elided[linenum] # You should always have a space after a comma (either as fn arg or operator) # # This does not apply when the non-space character following the # comma is another comma, since the only time when that happens is # for empty macro arguments. # # We run this check in two passes: first pass on elided lines to # verify that lines contain missing whitespaces, second pass on raw # lines to confirm that those missing whitespaces are not due to # elided comments. if (Search(r',[^,\s]', ReplaceAll(r'\boperator\s*,\s*\(', 'F(', line)) and Search(r',[^,\s]', raw[linenum])): error(filename, linenum, 'whitespace/comma', 3, 'Missing space after ,') # You should always have a space after a semicolon # except for few corner cases # TODO(unknown): clarify if 'if (1) { return 1;}' is requires one more # space after ; if Search(r';[^\s};\\)/]', line): error(filename, linenum, 'whitespace/semicolon', 3, 'Missing space after ;') 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 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: # Constructor() : initializer_list_{} { ... } # Constructor{}.MemberFunction() # Type variable{}; # FunctionCall(type{}, ...); # LastArgument(..., type{}); # LOG(INFO) << type{} << " ..."; # map_of_type[{...}] = ...; # ternary = expr ? new type{} : nullptr; # OuterTemplate{}> # # We check for the character following the closing brace, and # silence the warning if it's one of those listed above, i.e. # "{.;,)<>]:". # # To account for nested initializer list, we allow any number of # closing braces up to "{;,)<". We can't simply silence the # warning on first sight of closing brace, because that would # cause false negatives for things that are not initializer lists. # Silence this: But not this: # Outer{ if (...) { # Inner{...} if (...){ // Missing space before { # }; } # # 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 = '' if endpos > -1: trailing_text = endline[endpos:] for offset in xrange(endlinenum + 1, min(endlinenum + 3, clean_lines.NumLines() - 1)): trailing_text += clean_lines.elided[offset] # 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 {') # Make sure '} else {' has spaces. if Search(r'}else', line): error(filename, linenum, 'whitespace/braces', 5, 'Missing space before else') # You shouldn't have a space before a semicolon at the end of the line. # There's a special case for "for" since the style guide allows space before # the semicolon there. if Search(r':\s*;\s*$', line): error(filename, linenum, 'whitespace/semicolon', 5, 'Semicolon defining empty statement. Use {} instead.') elif Search(r'^\s*;\s*$', line): error(filename, linenum, 'whitespace/semicolon', 5, 'Line contains only semicolon. If this should be an empty statement, ' 'use {} instead.') elif (Search(r'\s+;\s*$', line) and not Search(r'\bfor\b', line)): error(filename, linenum, 'whitespace/semicolon', 5, 'Extra space before last semicolon. If this should be an empty ' 'statement, use {} instead.') def IsDecltype(clean_lines, linenum, column): """Check if the token ending on (linenum, column) is decltype(). 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 decltype() expression, False otherwise. """ (text, _, start_col) = ReverseCloseExpression(clean_lines, linenum, column) if start_col < 0: return False if Search(r'\bdecltype\s*$', text[0:start_col]): return True return False def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number of the line to check. error: The function to call with any errors found. """ # Skip checks if the class is small, where small means 25 lines or less. # 25 lines seems like a good cutoff since that's the usual height of # terminals, and any class that can't fit in one screen can't really # be considered "small". # # Also skip checks if we are on the first line. This accounts for # classes that look like # class Foo { public: ... }; # # If we didn't find the end of the class, last_line would be zero, # and the check will be skipped by the first condition. if (class_info.last_line - class_info.starting_linenum <= 24 or linenum <= class_info.starting_linenum): return matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum]) if matched: # Issue warning if the line before public/protected/private was # not a blank line, but don't do this if the previous line contains # "class" or "struct". This can happen two ways: # - We are at the beginning of the class. # - We are forward-declaring an inner class that is semantically # private, but needed to be public for implementation reasons. # Also ignores cases where the previous line ends with a backslash as can be # common when defining classes in C macros. prev_line = clean_lines.lines[linenum - 1] if (not IsBlankLine(prev_line) and not Search(r'\b(class|struct)\b', prev_line) and not Search(r'\\$', prev_line)): # Try a bit harder to find the beginning of the class. This is to # account for multi-line base-specifier lists, e.g.: # class Derived # : public Base { end_class_head = class_info.starting_linenum for i in range(class_info.starting_linenum, linenum): if Search(r'\{\s*$', clean_lines.lines[i]): end_class_head = i break if end_class_head < linenum - 1: error(filename, linenum, 'whitespace/blank_line', 3, '"%s:" should be preceded by a blank line' % matched.group(1)) def GetPreviousNonBlankLine(clean_lines, linenum): """Return the most recent non-blank line and its line number. Args: clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check. Returns: A tuple with two elements. The first element is the contents of the last non-blank line before the current line, or the empty string if this is the first non-blank line. The second is the line number of that line, or -1 if this is the first non-blank line. """ prevlinenum = linenum - 1 while prevlinenum >= 0: prevline = clean_lines.elided[prevlinenum] if not IsBlankLine(prevline): # if not a blank line... return (prevline, prevlinenum) prevlinenum -= 1 return ('', -1) def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). 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] # get rid of comments and strings if Match(r'\s*{\s*$', line): # We allow an open brace to start a line in the case where someone is using # braces in a block to explicitly create a new scope, which is commonly used # to control the lifetime of stack-allocated variables. Braces are also # 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. 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) 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') # An else clause should be on the same line as the preceding closing brace. if Match(r'\s*else\b\s*(?:if\b|\{|$)', line): prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] if Match(r'\s*}\s*$', prevline): error(filename, linenum, 'whitespace/newline', 4, 'An else should appear on the same line as the preceding }') # If braces come on one side of an else, they should be on both. # However, we have to worry about "else if" that spans multiple lines! if Search(r'else if\s*\(', line): # could be multi-line if brace_on_left = bool(Search(r'}\s*else if\s*\(', line)) # find the ( after the if pos = line.find('else if') pos = line.find('(', pos) if pos > 0: (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos) brace_on_right = endline[endpos:].find('{') != -1 if brace_on_left != brace_on_right: # must be brace after if error(filename, linenum, 'readability/braces', 5, 'If an else has a brace on one side, it should have it on both') elif Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line): error(filename, linenum, 'readability/braces', 5, 'If an else has a brace on one side, it should have it on both') # Likewise, an else should never have the else clause on the same line if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line): error(filename, linenum, 'whitespace/newline', 4, 'Else clause should never be on same line as else (use 2 lines)') # In the same way, a do/while should never be on one line if Match(r'\s*do [^\s{]', line): error(filename, linenum, 'whitespace/newline', 4, 'do/while clauses should not be on a single line') # Check single-line if/else bodies. The style guide says 'curly braces are not # required for single-line statements'. We additionally allow multi-line, # single statements, but we reject anything with more than one semicolon in # it. This means that the first semicolon after the if should be at the end of # 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*(|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*(|constexpr)\s*\(', line) if if_match: # This could be a multiline if condition, so find the end first. pos = if_match.end() - 1 (endline, endlinenum, endpos) = CloseExpression(clean_lines, linenum, pos) # Check for an opening brace, either directly after the if or on the next # line. If found, this isn't a single-statement conditional. if (not Match(r'\s*{', endline[endpos:]) and not (Match(r'\s*$', endline[endpos:]) and endlinenum < (len(clean_lines.elided) - 1) and Match(r'\s*{', clean_lines.elided[endlinenum + 1]))): while (endlinenum < len(clean_lines.elided) and ';' not in clean_lines.elided[endlinenum][endpos:]): endlinenum += 1 endpos = 0 if endlinenum < len(clean_lines.elided): endline = clean_lines.elided[endlinenum] # We allow a mix of whitespace and closing braces (e.g. for one-liner # methods) and a single \ after the semicolon (for macros) endpos = endline.find(';') if not Match(r';[\s}]*(\\?)$', endline[endpos:]): # Semicolon isn't the last character, there's something trailing. # Output a warning if the semicolon is not contained inside # a lambda expression. if not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}]*\}\s*\)*[;,]\s*$', endline): error(filename, linenum, 'readability/braces', 4, 'If/else bodies with multiple statements require braces') elif endlinenum < len(clean_lines.elided) - 1: # Make sure the next line is dedented next_line = clean_lines.elided[endlinenum + 1] next_indent = GetIndentLevel(next_line) # With ambiguous nested if statements, this will error out on the # if that *doesn't* match the else, regardless of whether it's the # inner one or outer one. if (if_match and Match(r'\s*else\b', next_line) and next_indent != if_indent): error(filename, linenum, 'readability/braces', 4, 'Else clause should be indented at the same level as if. ' 'Ambiguous nested if/else chains require braces.') elif next_indent > if_indent: error(filename, linenum, 'readability/braces', 4, 'If/else bodies with multiple statements require braces') def CheckTrailingSemicolon(filename, clean_lines, linenum, error): """Looks for redundant trailing semicolon. 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] # Block bodies should not be followed by a semicolon. Due to C++11 # brace initialization, there are more places where semicolons are # required than not, so we explicitly list the allowed rules rather # than listing the disallowed ones. These are the places where "};" # should be replaced by just "}": # 1. Some flavor of block following closing parenthesis: # for (;;) {}; # while (...) {}; # switch (...) {}; # Function(...) {}; # if (...) {}; # if (...) else if (...) {}; # # 2. else block: # if (...) else {}; # # 3. const member function: # Function(...) const {}; # # 4. Block following some statement: # x = 42; # {}; # # 5. Block at the beginning of a function: # Function(...) { # {}; # } # # Note that naively checking for the preceding "{" will also match # braces inside multi-dimensional arrays, but this is fine since # that expression will not contain semicolons. # # 6. Block following another block: # while (true) {} # {}; # # 7. End of namespaces: # namespace {}; # # These semicolons seems far more common than other kinds of # redundant semicolons, possibly due to people converting classes # to namespaces. For now we do not warn for this case. # # Try matching case 1 first. match = Match(r'^(.*\)\s*)\{', line) if match: # Matched closing parenthesis (case 1). Check the token before the # matching opening parenthesis, and don't warn if it looks like a # macro. This avoids these false positives: # - macro that defines a base class # - multi-line macro that defines a base class # - macro that defines the whole class-head # # But we still issue warnings for macros that we know are safe to # warn, specifically: # - TEST, TEST_F, TEST_P, MATCHER, MATCHER_P # - TYPED_TEST # - INTERFACE_DEF # - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED: # # We implement a list of safe macros instead of a list of # unsafe macros, even though the latter appears less frequently in # google code and would have been easier to implement. This is because # the downside for getting the allowed checks wrong means some extra # semicolons, while the downside for getting disallowed checks wrong # would result in compile errors. # # In addition to macros, we also don't want to warn on # - Compound literals # - Lambdas # - 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_][A-Z0-9_]*)\s*$', line_prefix) func = Match(r'^(.*\])\s*$', line_prefix) if ((macro and macro.group(1) not in ( 'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST', 'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED', '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 opening_parenthesis[1] > 1 and Search(r'\]\s*$', clean_lines.elided[opening_parenthesis[1] - 1])): # Multi-line lambda-expression match = None else: # Try matching cases 2-3. match = Match(r'^(.*(?:else|\)\s*const)\s*)\{', line) if not match: # Try matching cases 4-6. These are always matched on separate lines. # # Note that we can't simply concatenate the previous line to the # current line and do a single match, otherwise we may output # duplicate warnings for the blank line case: # if (cond) { # // blank line # } prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] if prevline and Search(r'[;{}]\s*$', prevline): match = Match(r'^(\s*)\{', line) # Check matching closing brace if match: (endline, endlinenum, endpos) = CloseExpression( clean_lines, linenum, len(match.group(1))) if endpos > -1 and Match(r'^\s*;', endline[endpos:]): # Current {} pair is eligible for semicolon check, and we have found # the redundant semicolon, output warning here. # # Note: because we are scanning forward for opening braces, and # 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 }") def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. 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. """ # Search for loop keywords at the beginning of the line. Because only # whitespaces are allowed before the keywords, this will also ignore most # do-while-loops, since those lines should start with closing brace. # # We also check "if" blocks here, since an empty conditional block # is likely an error. line = clean_lines.elided[linenum] matched = Match(r'\s*(for|while|if)\s*\(', line) if matched: # Find the end of the conditional expression. (end_line, end_linenum, end_pos) = CloseExpression( clean_lines, linenum, line.find('(')) # Output warning if what follows the condition expression is a semicolon. # No warning for all other cases, including whitespace or newline, since we # have a separate check for semicolons preceded by whitespace. if end_pos >= 0 and Match(r';', end_line[end_pos:]): if matched.group(1) == 'if': error(filename, end_linenum, 'whitespace/empty_conditional_body', 5, 'Empty conditional bodies should use {}') else: 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. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found. """ for macro in _CHECK_MACROS: i = line.find(macro) if i >= 0: # Find opening parenthesis. Do a regular expression match here # to make sure that we are matching the expected CHECK macro, as # opposed to some other macro that happens to contain the CHECK # substring. matched = Match(r'^(.*\b' + macro + r'\s*)\(', line) if not matched: continue return (macro, len(matched.group(1))) return (None, -1) def CheckCheck(filename, clean_lines, linenum, error): """Checks the use of CHECK and EXPECT 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. error: The function to call with any errors found. """ # Decide the set of replacement macros that should be suggested lines = clean_lines.elided (check_macro, start_pos) = FindCheckMacro(lines[linenum]) if not check_macro: return # Find end of the boolean expression by matching parentheses (last_line, end_line, end_pos) = CloseExpression( clean_lines, linenum, start_pos) if end_pos < 0: return # If the check macro is followed by something other than a # semicolon, assume users will log their own custom error messages # and don't suggest any replacements. if not Match(r'\s*;', last_line[end_pos:]): return if linenum == end_line: expression = lines[linenum][start_pos + 1:end_pos - 1] else: expression = lines[linenum][start_pos + 1:] for i in xrange(linenum + 1, end_line): expression += lines[i] expression += last_line[0:end_pos - 1] # Parse expression so that we can take parentheses into account. # This avoids false positives for inputs like "CHECK((a < 4) == b)", # which is not replaceable by CHECK_LE. lhs = '' rhs = '' operator = None while expression: matched = Match(r'^\s*(<<|<<=|>>|>>=|->\*|->|&&|\|\||' r'==|!=|>=|>|<=|<|\()(.*)$', expression) if matched: token = matched.group(1) if token == '(': # Parenthesized operand expression = matched.group(2) (end, _) = FindEndOfExpressionInLine(expression, 0, ['(']) if end < 0: return # Unmatched parenthesis lhs += '(' + expression[0:end] expression = expression[end:] elif token in ('&&', '||'): # Logical and/or operators. This means the expression # contains more than one term, for example: # CHECK(42 < a && a < b); # # These are not replaceable with CHECK_LE, so bail out early. return elif token in ('<<', '<<=', '>>', '>>=', '->*', '->'): # Non-relational operator lhs += token expression = matched.group(2) else: # Relational operator operator = token rhs = matched.group(2) break else: # Unparenthesized operand. Instead of appending to lhs one character # at a time, we do another regular expression match to consume several # characters at once if possible. Trivial benchmark shows that this # is more efficient when the operands are longer than a single # character, which is generally the case. matched = Match(r'^([^-=!<>()&|]+)(.*)$', expression) if not matched: matched = Match(r'^(\s*\S)(.*)$', expression) if not matched: break lhs += matched.group(1) expression = matched.group(2) # Only apply checks if we got all parts of the boolean expression if not (lhs and operator and rhs): return # Check that rhs do not contain logical operators. We already know # that lhs is fine since the loop above parses out && and ||. if rhs.find('&&') > -1 or rhs.find('||') > -1: return # At least one of the operands must be a constant literal. This is # to avoid suggesting replacements for unprintable things like # CHECK(variable != iterator) # # The following pattern matches decimal, hex integers, strings, and # characters (in that order). lhs = lhs.strip() rhs = rhs.strip() match_constant = r'^([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')$' if Match(match_constant, lhs) or Match(match_constant, rhs): # Note: since we know both lhs and rhs, we can provide a more # descriptive error message like: # Consider using CHECK_EQ(x, 42) instead of CHECK(x == 42) # Instead of: # Consider using CHECK_EQ instead of CHECK(a == b) # # We are still keeping the less descriptive message because if lhs # or rhs gets long, the error message might become unreadable. error(filename, linenum, 'readability/check', 2, 'Consider using %s instead of %s(a %s b)' % ( _CHECK_REPLACEMENT[check_macro][operator], check_macro, operator)) def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. 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] # Avoid preprocessor lines if Match(r'^\s*#', line): return # Last ditch effort to avoid multi-line comments. This will not help # if the comment started before the current line or ended after the # current line, but it catches most of the false positives. At least, # it provides a way to workaround this warning for people who use # multi-line comments in preprocessor macros. # # TODO(unknown): remove this once cpplint has better support for # multi-line comments. if line.find('/*') >= 0 or line.find('*/') >= 0: return for match in _ALT_TOKEN_REPLACEMENT_PATTERN.finditer(line): error(filename, linenum, 'readability/alt_tokens', 2, 'Use operator %s instead of %s' % ( _ALT_TOKEN_REPLACEMENT[match.group(1)], match.group(1))) def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width = 0 for uc in unicodedata.normalize('NFC', 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: return len(line) def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error): """Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside code, etc. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. file_extension: The extension (without the dot) of the filename. 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. """ # Don't use "elided" lines here, otherwise we can't check commented lines. # Don't want to use "raw" either, because we don't want to check inside C++11 # 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, 'Tab found; better to use spaces') # One or three blank spaces at the beginning of the line is weird; it's # hard to reconcile that with 2-space indents. # NOTE: here are the conditions rob pike used for his tests. Mine aren't # as sophisticated, but it may be worth becoming so: RLENGTH==initial_spaces # if(RLENGTH > 20) complain = 0; # if(match($0, " +(error|private|public|protected):")) complain = 0; # if(match(prev, "&& *$")) complain = 0; # if(match(prev, "\\|\\| *$")) complain = 0; # if(match(prev, "[\",=><] *$")) complain = 0; # if(match($0, " <<")) complain = 0; # if(match(prev, " +for \\(")) complain = 0; # if(prevodd && match(prevprev, " +for \\(")) complain = 0; scope_or_label_pattern = r'\s*(?:public|private|protected|signals)(?:\s+(?:slots\s*)?)?:\s*\\?$' classinfo = nesting_state.InnermostClass() initial_spaces = 0 cleansed_line = clean_lines.elided[linenum] while initial_spaces < len(line) and line[initial_spaces] == ' ': initial_spaces += 1 # There are certain situations we allow one space, notably for # section labels, and also lines containing multi-line raw strings. # 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 IsHeaderExtension(file_extension): cppvar = GetHeaderGuardCPPVariable(filename) if (line.startswith('#ifndef %s' % cppvar) or line.startswith('#define %s' % cppvar) or line.startswith('#endif // %s' % cppvar)): is_header_guard = True # #include lines and header guards can be long, since there's no clean way to # split them. # # URLs can be long too. It's possible to split these, but it makes them # harder to cut&paste. # # 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'^\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) 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 GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and # It's ok to have many commands in a switch case that fits in 1 line not ((cleansed_line.find('case ') != -1 or cleansed_line.find('default:') != -1) and cleansed_line.find('break;') != -1)): error(filename, linenum, 'whitespace/newline', 0, 'More than one command on the same line') # Some more style checks CheckBraces(filename, clean_lines, linenum, error) CheckTrailingSemicolon(filename, clean_lines, linenum, error) CheckEmptyBlockBody(filename, clean_lines, linenum, 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, nesting_state, error) CheckSpacingForFunctionCall(filename, clean_lines, linenum, error) CheckCheck(filename, clean_lines, linenum, error) CheckAltTokens(filename, clean_lines, linenum, error) classinfo = nesting_state.InnermostClass() if classinfo: CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error) _RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$') # Matches the first component of a filename delimited by -s and _s. That is: # _RE_FIRST_COMPONENT.match('foo').group(0) == 'foo' # _RE_FIRST_COMPONENT.match('foo.cc').group(0) == 'foo' # _RE_FIRST_COMPONENT.match('foo-bar_baz.cc').group(0) == 'foo' # _RE_FIRST_COMPONENT.match('foo_bar-baz.cc').group(0) == 'foo' _RE_FIRST_COMPONENT = re.compile(r'^[^-_.]+') def _DropCommonSuffixes(filename): """Drops common suffixes like _test.cc or -inl.h from filename. For example: >>> _DropCommonSuffixes('foo/foo-inl.h') 'foo/foo' >>> _DropCommonSuffixes('foo/bar/foo.cc') 'foo/bar/foo' >>> _DropCommonSuffixes('foo/foo_internal.h') 'foo/foo' >>> _DropCommonSuffixes('foo/foo_unusualinternal.h') 'foo/foo_unusualinternal' Args: filename: The input filename. Returns: The filename with the common suffix removed. """ 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 _ClassifyInclude(fileinfo, include, used_angle_brackets, include_order="default"): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. used_angle_brackets: True if the #include used <> rather than "". include_order: "default" or other value allowed in program arguments Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'stdio.h', True) _C_SYS_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'string', True) _CPP_SYS_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', True, "standardcfirst") _OTHER_SYS_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', False) _LIKELY_MY_HEADER >>> _ClassifyInclude(FileInfo('foo/foo_unknown_extension.cc'), ... 'bar/foo_other_ext.h', False) _POSSIBLE_MY_HEADER >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/bar.h', False) _OTHER_HEADER """ # This is a list of all standard c++ header files, except # those already checked for above. is_cpp_header = include in _CPP_HEADERS # Mark include as C header if in list or in a known folder for standard-ish C headers. is_std_c_header = (include_order == "default") or (include in _C_HEADERS # additional linux glibc header folders or Search(r'(?:%s)\/.*\.h' % "|".join(C_STANDARD_HEADER_FOLDERS), include)) # Headers with C++ extensions shouldn't be considered C system headers is_system = used_angle_brackets and not os.path.splitext(include)[1] in ['.hpp', '.hxx', '.h++'] if is_system: if is_cpp_header: return _CPP_SYS_HEADER if is_std_c_header: return _C_SYS_HEADER else: return _OTHER_SYS_HEADER # If the target file and the include we're checking share a # basename when we drop common extensions, and the include # lives in . , then it's likely to be owned by the target file. 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 == target_dir_pub): return _LIKELY_MY_HEADER # If the target and include share some initial basename # component, it's possible the target is implementing the # include, so it's allowed to be first, but we'll never # complain if it's not there. target_first_component = _RE_FIRST_COMPONENT.match(target_base) include_first_component = _RE_FIRST_COMPONENT.match(include_base) if (target_first_component and include_first_component and target_first_component.group(0) == include_first_component.group(0)): return _POSSIBLE_MY_HEADER return _OTHER_HEADER def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. include_state: An _IncludeState instance in which the headers are inserted. error: The function to call with any errors found. """ fileinfo = FileInfo(filename) line = clean_lines.lines[linenum] # "include" should use the new style "foo/bar.h" instead of just "bar.h" # Only do this check if the included header follows google naming # conventions. If not, assume that it's a 3rd party API that # requires special include conventions. # # We also make an exception for Lua headers, which follow google # 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_subdir', 4, 'Include the directory when naming .h files') # we shouldn't include a file more than once. actually, there are a # handful of instances where doing so is okay, but in general it's # not. match = _RE_PATTERN_INCLUDE.search(line) if match: include = match.group(2) used_angle_brackets = (match.group(1) == '<') duplicate_line = include_state.FindHeader(include) if duplicate_line >= 0: error(filename, linenum, 'build/include', 4, '"%s" already included at %s:%s' % (include, filename, duplicate_line)) 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 .' + 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: # 1) for foo.cc, foo.h (preferred location) # 2) c system files # 3) cpp system files # 4) for foo.cc, foo.h (deprecated location) # 5) other google headers # # We classify each include statement as one of those 5 types # using a number of techniques. The include_state object keeps # track of the highest type seen, and complains if we see a # lower type after that. error_message = include_state.CheckNextIncludeOrder( _ClassifyInclude(fileinfo, include, used_angle_brackets, _include_order)) if error_message: error(filename, linenum, 'build/include_order', 4, '%s. Should be: %s.h, c system, c++ system, other.' % (error_message, fileinfo.BaseName())) canonical_include = include_state.CanonicalizeAlphabeticalOrder(include) if not include_state.IsInAlphabeticalOrder( clean_lines, linenum, canonical_include): error(filename, linenum, 'build/include_alpha', 4, 'Include "%s" not in alphabetical order' % include) include_state.SetLastHeader(canonical_include) def _GetTextInside(text, start_pattern): r"""Retrieves all the text between matching open and close parentheses. Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of the punctuations, so for the text like printf(a(), b(c())); a call to _GetTextInside(text, r'printf\(') will return 'a(), b(c())'. start_pattern must match string having an open punctuation symbol at the end. Args: text: The lines to extract text. Its comments and strings must be elided. It can be single line and can span multiple lines. start_pattern: The regexp string indicating where to start extracting the text. Returns: The extracted text. None if either the opening string or ending punctuation could not be found. """ # TODO(unknown): Audit cpplint.py to see what places could be profitably # rewritten to use _GetTextInside (and use inferior regexp matching today). # Give opening punctuations to get the matching close-punctuations. matching_punctuation = {'(': ')', '{': '}', '[': ']'} closing_punctuation = set(itervalues(matching_punctuation)) # Find the position to start extracting text. match = re.search(start_pattern, text, re.M) if not match: # start_pattern not found in text. return None start_position = match.end(0) assert start_position > 0, ( 'start_pattern must ends with an opening punctuation.') assert text[start_position - 1] in matching_punctuation, ( 'start_pattern must ends with an opening punctuation.') # Stack of closing punctuations we expect to have in text after position. punctuation_stack = [matching_punctuation[text[start_position - 1]]] position = start_position while punctuation_stack and position < len(text): if text[position] == punctuation_stack[-1]: punctuation_stack.pop() elif text[position] in closing_punctuation: # A closing punctuation without matching opening punctuations. return None elif text[position] in matching_punctuation: punctuation_stack.append(matching_punctuation[text[position]]) position += 1 if punctuation_stack: # Opening punctuations left without matching close-punctuations. return None # punctuations match. return text[start_position:position - 1] # Patterns for matching call-by-reference parameters. # # Supports nested templates up to 2 levels deep using this messy pattern: # < (?: < (?: < [^<>]* # > # | [^<>] )* # > # | [^<>] )* # > _RE_PATTERN_IDENT = r'[_a-zA-Z]\w*' # =~ [[:alpha:]][[:alnum:]]* _RE_PATTERN_TYPE = ( r'(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+)?' r'(?:\w|' r'\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|' r'::)+') # A call-by-reference parameter ends with '& identifier'. _RE_PATTERN_REF_PARAM = re.compile( r'(' + _RE_PATTERN_TYPE + r'(?:\s*(?:\bconst\b|[*]))*\s*' r'&\s*' + _RE_PATTERN_IDENT + r')\s*(?:=[^,()]+)?[,)]') # A call-by-const-reference parameter either ends with 'const& identifier' # or looks like 'const type& identifier' when 'type' is atomic. _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, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. file_extension: The extension (without the dot) of the filename. include_state: An _IncludeState instance in which the headers are inserted. 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. """ # If the line is empty or consists of entirely a comment, no need to # check it. line = clean_lines.elided[linenum] if not line: return match = _RE_PATTERN_INCLUDE.search(line) if match: CheckIncludeLine(filename, clean_lines, linenum, include_state, error) return # Reset include state across preprocessor directives. This is meant # to silence warnings for conditional includes. match = Match(r'^\s*#\s*(if|ifdef|ifndef|elif|else|endif)\b', line) if match: include_state.ResetSection(match.group(1)) # 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 IsHeaderExtension(file_extension): # TODO(unknown): check that 1-arg constructors are explicit. # How to tell it's a constructor? # (handled in CheckForNonStandardConstructs for now) # TODO(unknown): check that classes declare or disable copy/assign # (level 1 error) pass # Check if people are using the verboten C basic types. The only exception # we regularly allow is "unsigned short port" for port. if Search(r'\bshort port\b', line): if not Search(r'\bunsigned short port\b', line): error(filename, linenum, 'runtime/int', 4, 'Use "unsigned short" for ports, not "short"') else: match = Search(r'\b(short|long(?! +double)|long long)\b', line) if match: error(filename, linenum, 'runtime/int', 4, 'Use int16/int64/etc, rather than the C type %s' % match.group(1)) # Check if some verboten operator overloading is going on # TODO(unknown): catch out-of-line unary operator&: # class X {}; # int operator&(const X& x) { return 42; } // unary operator& # The trick is it's hard to tell apart from binary operator&: # class Y { int operator&(const Y& x) { return 23; } }; // binary operator& if Search(r'\boperator\s*&\s*\(\s*\)', line): error(filename, linenum, 'runtime/operator', 4, 'Unary operator& is dangerous. Do not use it.') # Check for suspicious usage of "if" like # } if (a == b) { if Search(r'\}\s*if\s*\(', line): error(filename, linenum, 'readability/braces', 4, 'Did you mean "else if"? If not, start a new line for "if".') # Check for potential format string bugs like printf(foo). # We constrain the pattern not to pick things like DocidForPrintf(foo). # Not perfect but it can catch printf(foo.c_str()) and printf(foo->c_str()) # TODO(unknown): Catch the following case. Need to change the calling # convention of the whole function to process multiple line to handle it. # printf( # boy_this_is_a_really_long_variable_that_cannot_fit_on_the_prev_line); printf_args = _GetTextInside(line, r'(?i)\b(string)?printf\s*\(') if printf_args: match = Match(r'([\w.\->()]+)$', printf_args) if match and match.group(1) != '__VA_ARGS__': function_name = re.search(r'\b((?:string)?printf)\s*\(', line, re.I).group(1) error(filename, linenum, 'runtime/printf', 4, 'Potential format string bug. Do %s("%%s", %s) instead.' % (function_name, match.group(1))) # Check for potential memset bugs like memset(buf, sizeof(buf), 0). match = Search(r'memset\s*\(([^,]*),\s*([^,]*),\s*0\s*\)', line) if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)): error(filename, linenum, 'runtime/memset', 4, 'Did you mean "memset(%s, 0, %s)"?' % (match.group(1), match.group(2))) if Search(r'\busing namespace\b', line): 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) if (match and match.group(2) != 'return' and match.group(2) != 'delete' and match.group(3).find(']') == -1): # Split the size using space and arithmetic operators as delimiters. # If any of the resulting tokens are not compile time constants then # report the error. tokens = re.split(r'\s|\+|\-|\*|\/|<<|>>]', match.group(3)) is_const = True skip_next = False for tok in tokens: if skip_next: skip_next = False continue if Search(r'sizeof\(.+\)', tok): continue if Search(r'arraysize\(\w+\)', tok): continue tok = tok.lstrip('(') tok = tok.rstrip(')') if not tok: continue if Match(r'\d+', tok): continue if Match(r'0[xX][0-9a-fA-F]+', tok): continue if Match(r'k[A-Z0-9]\w*', tok): continue if Match(r'(.+::)?k[A-Z0-9]\w*', tok): continue if Match(r'(.+::)?[A-Z][A-Z0-9_]*', tok): continue # A catch all for tricky sizeof cases, including 'sizeof expression', # 'sizeof(*type)', 'sizeof(const type)', 'sizeof(struct StructName)' # requires skipping the next token because we split on ' ' and '*'. if tok.startswith('sizeof'): skip_next = True continue is_const = False break if not is_const: error(filename, linenum, 'runtime/arrays', 1, 'Do not use variable-length arrays. Use an appropriately named ' "('k' followed by CamelCase) compile-time constant for the size.") # 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 (IsHeaderExtension(file_extension) and Search(r'\bnamespace\s*{', line) and line[-1] != '\\'): error(filename, linenum, 'build/namespaces_headers', 4, 'Do not use unnamed namespaces in header files. See ' 'https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' ' for more information.') def CheckGlobalStatic(filename, clean_lines, linenum, error): """Check for unsafe global or static objects. 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] # Match two lines at a time to support multiline declarations if linenum + 1 < clean_lines.NumLines() and not Search(r'[;({]', line): line += clean_lines.elided[linenum + 1].strip() # 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, 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 +))(?::*std::)?string( +const)? +' r'([a-zA-Z0-9_:]+)\b(.*)', line) # Remove false positives: # - String pointers (as opposed to values). # string *pointer # const string *pointer # string const *pointer # string *const pointer # # - Functions and template specializations. # string Function(... # string Class::Method(... # # - Operators. These are matched separately because operator names # cross non-word boundaries, and trying to match both operators # and functions at the same time would decrease accuracy of # 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'\boperator\W', line) and 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) 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.') def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. 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] # When snprintf is used, the second argument shouldn't be a literal. match = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', line) if match and match.group(2) != '0': # If 2nd arg is zero, snprintf is used to calculate size. error(filename, linenum, 'runtime/printf', 3, 'If you can, use sizeof(%s) instead of %s as the 2nd arg ' 'to snprintf.' % (match.group(1), match.group(2))) # Check if some verboten C functions are being used. if Search(r'\bsprintf\s*\(', line): error(filename, linenum, 'runtime/printf', 5, 'Never use sprintf. Use snprintf instead.') match = Search(r'\b(strcpy|strcat)\s*\(', line) if match: error(filename, linenum, 'runtime/printf', 4, 'Almost always, snprintf is better than %s' % match.group(1)) def IsDerivedFunction(clean_lines, linenum): """Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier. """ # Scan back a few lines for start of current function for i in xrange(linenum, max(-1, linenum - 10), -1): match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i]) if match: # Look for "override" after the matching closing parenthesis line, _, closing_paren = CloseExpression( clean_lines, i, len(match.group(1))) return (closing_paren >= 0 and Search(r'\boverride\b', line[closing_paren:])) return False def IsOutOfLineMethodDefinition(clean_lines, linenum): """Check if current line contains an out-of-line method definition. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains an out-of-line method definition. """ # Scan back a few lines for start of current function for i in xrange(linenum, max(-1, linenum - 10), -1): if Match(r'^([^()]*\w+)\(', clean_lines.elided[i]): return Match(r'^[^()]*\w+::\w+\(', clean_lines.elided[i]) is not None return False def IsInitializerList(clean_lines, linenum): """Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list, False otherwise. """ for i in xrange(linenum, 1, -1): line = clean_lines.elided[i] if i == linenum: remove_function_body = Match(r'^(.*)\{\s*$', line) if remove_function_body: line = remove_function_body.group(1) if Search(r'\s:\s*\w+[({]', line): # A lone colon tend to indicate the start of a constructor # initializer list. It could also be a ternary operator, which # also tend to appear in constructor initializer lists as # opposed to parameter lists. return True if Search(r'\}\s*,\s*$', line): # A closing brace followed by a comma is probably the end of a # brace-initialized member in constructor initializer list. return True if Search(r'[{};]\s*$', line): # Found one of the following: # - A closing brace or semicolon, probably the end of the previous # function. # - An opening brace, probably the start of current class or namespace. # # Current line is probably not inside an initializer list since # we saw one of those things without seeing the starting colon. return False # Got to the beginning of the file without seeing the start of # constructor initializer list. return False def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error): """Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. 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. """ # Do nothing if there is no '&' on current line. line = clean_lines.elided[linenum] if '&' not in line: return # If a function is inherited, current function doesn't have much of # a choice, so any non-const references should not be blamed on # derived function. if IsDerivedFunction(clean_lines, linenum): return # Don't warn on out-of-line method definitions, as we would warn on the # in-line declaration, if it isn't marked with 'override'. if IsOutOfLineMethodDefinition(clean_lines, linenum): return # Long type names may be broken across multiple lines, usually in one # of these forms: # LongType # ::LongTypeContinued &identifier # LongType:: # LongTypeContinued &identifier # LongType< # ...>::LongTypeContinued &identifier # # If we detected a type split across two lines, join the previous # line to current line so that we can match const references # accordingly. # # Note that this only scans back one line, since scanning back # arbitrary number of lines would be expensive. If you have a type # that spans more than 2 lines, please use a typedef. if linenum > 1: previous = None if Match(r'\s*::(?:[\w<>]|::)+\s*&\s*\S', line): # previous_line\n + ::current_line previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+[\w<>])\s*$', clean_lines.elided[linenum - 1]) elif Match(r'\s*[a-zA-Z_]([\w<>]|::)+\s*&\s*\S', line): # previous_line::\n + current_line previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+::)\s*$', clean_lines.elided[linenum - 1]) if previous: line = previous.group(1) + line.lstrip() else: # Check for templated parameter that is split across multiple lines endpos = line.rfind('>') if endpos > -1: (_, startline, startpos) = ReverseCloseExpression( clean_lines, linenum, endpos) if startpos > -1 and startline < linenum: # Found the matching < on an earlier line, collect all # pieces up to current line. line = '' for i in xrange(startline, linenum + 1): line += clean_lines.elided[i].strip() # Check for non-const references in function parameters. A single '&' may # found in the following places: # inside expression: binary & for bitwise AND # inside expression: unary & for taking the address of something # inside declarators: reference parameter # We will exclude the first two cases by checking that we are not inside a # function body, including one that was just introduced by a trailing '{'. # TODO(unknown): Doesn't account for 'catch(Exception& e)' [rare]. if (nesting_state.previous_stack_top and not (isinstance(nesting_state.previous_stack_top, _ClassInfo) or isinstance(nesting_state.previous_stack_top, _NamespaceInfo))): # Not at toplevel, not within a class, and not within a namespace return # Avoid initializer lists. We only need to scan back from the # current line for something that starts with ':'. # # We don't need to check the current line, since the '&' would # appear inside the second set of parentheses on the current line as # opposed to the first set. if linenum > 0: for i in xrange(linenum - 1, max(0, linenum - 10), -1): previous_line = clean_lines.elided[i] if not Search(r'[),]\s*$', previous_line): break if Match(r'^\s*:\s+\S', previous_line): return # Avoid preprocessors if Search(r'\\\s*$', line): return # Avoid constructor initializer lists if IsInitializerList(clean_lines, linenum): return # We allow non-const references in a few standard places, like functions # called "swap()" or iostream operators like "<<" or ">>". Do not check # those function parameters. # # We also accept & in static_assert, which looks like a function but # it's actually a declaration expression. allowed_functions = (r'(?:[sS]wap(?:<\w:+>)?|' r'operator\s*[<>][<>]|' r'static_assert|COMPILE_ASSERT' r')\s*\(') if Search(allowed_functions, line): return elif not Search(r'\S+\([^)]*$', line): # Don't see an allowed function on this line. Actually we # didn't see any function name on this line, so this is likely a # multi-line parameter list. Try a bit harder to catch this case. for i in xrange(2): if (linenum > i and Search(allowed_functions, clean_lines.elided[linenum - i - 1])): return 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) 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: ' + ReplaceAll(' *<', '<', parameter)) def CheckCasts(filename, clean_lines, linenum, error): """Various cast related checks. 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] # Check to see if they're using an conversion function cast. # I just try to capture the most common basic types, though there are more. # Parameterless conversion functions, such as bool(), are allowed as they are # probably a member operator declaration or default constructor. match = Search( 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) if match and not expecting_function: matched_type = match.group(2) # matched_new_or_template is used to silence two false positives: # - New operators # - Template arguments with function types # # For template arguments, we match on types immediately following # an opening bracket without any spaces. This is a fast way to # silence the common case where the function type is the first # template argument. False negative with less-than comparison is # avoided because those operators are usually followed by a space. # # function // bracket + no space = false positive # value < double(42) // bracket + space = true positive matched_new_or_template = match.group(1) # Avoid arrays by looking for brackets that come after the closing # parenthesis. if Match(r'\([^()]+\)\s*\[', match.group(3)): return # Other things to ignore: # - Function pointers # - Casts to pointer types # - Placement new # - Alias declarations matched_funcptr = match.group(3) if (matched_new_or_template is None and not (matched_funcptr and (Match(r'\((?:[^() ]+::\s*\*\s*)?[^() ]+\)\s*\(', matched_funcptr) or matched_funcptr.startswith('(*)'))) and not Match(r'\s*using\s+\S+\s*=\s*' + matched_type, line) and not Search(r'new\(\S+\)\s*' + matched_type, line)): error(filename, linenum, 'readability/casting', 4, 'Using deprecated casting style. ' 'Use static_cast<%s>(...) instead' % matched_type) if not expecting_function: CheckCStyleCast(filename, clean_lines, linenum, 'static_cast', r'\((int|float|double|bool|char|u?int(16|32|64)|size_t)\)', error) # This doesn't catch all cases. Consider (const char * const)"hello". # # (char *) "foo" should always be a const_cast (reinterpret_cast won't # compile). if CheckCStyleCast(filename, clean_lines, linenum, 'const_cast', r'\((char\s?\*+\s?)\)\s*"', error): pass else: # Check pointer casts for other than string constants CheckCStyleCast(filename, clean_lines, linenum, 'reinterpret_cast', r'\((\w+\s?\*+\s?)\)', error) # In addition, we look for people taking the address of a cast. This # is dangerous -- casts can assign to temporaries, so the pointer doesn't # point where you think. # # Some non-identifier character is required before the '&' for the # expression to be recognized as a cast. These are casts: # expression = &static_cast(temporary()); # function(&(int*)(temporary())); # # This is not a cast: # reference_type&(int* function_param); match = Search( r'(?:[^\w]&\(([^)*][^)]*)\)[\w(])|' r'(?:[^\w]&(static|dynamic|down|reinterpret)_cast\b)', line) if match: # Try a better error message when the & is bound to something # dereferenced by the casted pointer, as opposed to the casted # pointer itself. parenthesis_error = False match = Match(r'^(.*&(?:static|dynamic|down|reinterpret)_cast\b)<', line) if match: _, y1, x1 = CloseExpression(clean_lines, linenum, len(match.group(1))) if x1 >= 0 and clean_lines.elided[y1][x1] == '(': _, y2, x2 = CloseExpression(clean_lines, y1, x1) if x2 >= 0: extended_line = clean_lines.elided[y2][x2:] if y2 < clean_lines.NumLines() - 1: extended_line += clean_lines.elided[y2 + 1] if Match(r'\s*(?:->|\[)', extended_line): parenthesis_error = True if parenthesis_error: error(filename, linenum, 'readability/casting', 4, ('Are you taking an address of something dereferenced ' 'from a cast? Wrapping the dereferenced expression in ' 'parentheses will make the binding more obvious')) else: error(filename, linenum, 'runtime/casting', 4, ('Are you taking an address of a cast? ' 'This is dangerous: could be a temp var. ' 'Take the address before doing the cast, rather than after')) def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The string for the C++ cast to recommend. This is either reinterpret_cast, static_cast, or const_cast, depending. pattern: The regular expression used to find C-style casts. error: The function to call with any errors found. Returns: True if an error was emitted. False otherwise. """ line = clean_lines.elided[linenum] match = Search(pattern, line) if not match: return False # Exclude lines with keywords that tend to look like casts context = line[0:match.start(1) - 1] if Match(r'.*\b(?:sizeof|alignof|alignas|[_A-Z][_A-Z0-9]*)\s*$', context): return False # Try expanding current context to see if we one level of # parentheses inside a macro. if linenum > 0: for i in xrange(linenum - 1, max(0, linenum - 5), -1): context = clean_lines.elided[i] + context if Match(r'.*\b[_A-Z][_A-Z0-9]*\s*\((?:\([^()]*\)|[^()])*$', context): return False # operator++(int) and operator--(int) 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. remainder = line[match.end(0):] if Match(r'^\s*(?:;|const\b|throw\b|final\b|override\b|[=>{),]|->)', remainder): return False # At this point, all that should be left is actual casts. error(filename, linenum, 'readability/casting', 4, 'Using C-style cast. Use %s<%s>(...) instead' % (cast_type, match.group(1))) return True def ExpectingFunctionArgs(clean_lines, linenum): """Checks whether where function type arguments are expected. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if the line at 'linenum' is inside something that expects arguments of function types. """ line = clean_lines.elided[linenum] return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or (linenum >= 2 and (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$', clean_lines.elided[linenum - 1]) or Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$', clean_lines.elided[linenum - 2]) or Search(r'\bstd::m?function\s*\<\s*$', clean_lines.elided[linenum - 1])))) _HEADERS_CONTAINING_TEMPLATES = ( ('', ('deque',)), ('', ('unary_function', 'binary_function', 'plus', 'minus', 'multiplies', 'divides', 'modulus', 'negate', 'equal_to', 'not_equal_to', 'greater', 'less', 'greater_equal', 'less_equal', 'logical_and', 'logical_or', 'logical_not', 'unary_negate', 'not1', 'binary_negate', 'not2', 'bind1st', 'bind2nd', 'pointer_to_unary_function', 'pointer_to_binary_function', 'ptr_fun', 'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t', 'mem_fun_ref_t', 'const_mem_fun_t', 'const_mem_fun1_t', 'const_mem_fun_ref_t', 'const_mem_fun1_ref_t', 'mem_fun_ref', )), ('', ('numeric_limits',)), ('', ('list',)), ('', ('multimap',)), ('', ('allocator', 'make_shared', 'make_unique', 'shared_ptr', 'unique_ptr', 'weak_ptr')), ('', ('queue', 'priority_queue',)), ('', ('multiset',)), ('', ('stack',)), ('', ('char_traits', 'basic_string',)), ('', ('tuple',)), ('', ('unordered_map', 'unordered_multimap')), ('', ('unordered_set', 'unordered_multiset')), ('', ('pair',)), ('', ('vector',)), # gcc extensions. # Note: std::hash is their hash, ::hash is our hash ('', ('hash_map', 'hash_multimap',)), ('', ('hash_set', 'hash_multiset',)), ('', ('slist',)), ) _HEADERS_MAYBE_TEMPLATES = ( ('', ('copy', 'max', 'min', 'min_element', 'sort', 'transform', )), ('', ('forward', 'make_pair', 'move', 'swap')), ) _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: _re_pattern_templates.append( (re.compile(r'(\<|\b)' + _template + r'\s*\<'), _template + '<>', _header)) def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to the same module here. If the filename_cc contains a longer path than the filename_h, for example, '/absolute/path/to/base/sysinfo.cc', and this file would include 'base/sysinfo.h', this function also produces the prefix needed to open the header. This is used by the caller of this function to more robustly open the header file. We don't have access to the real include paths in this context, so we need this guesswork here. Known bugs: tools/base/bar.cc and base/bar.h belong to the same module according to this implementation. Because of this, this function gives some false positives. This should be sufficiently rare in practice. Args: filename_cc: is the path for the source (e.g. .cc) file filename_h: is the path for the header path Returns: Tuple with a bool and a string: 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, '') fileinfo_h = FileInfo(filename_h) if not IsHeaderExtension(fileinfo_h.Extension().lstrip('.')): return (False, '') 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/', '/') 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/', '/') filename_h = filename_h.replace('/internal/', '/') files_belong_to_same_module = filename_cc.endswith(filename_h) common_path = '' if files_belong_to_same_module: common_path = filename_cc[:-len(filename_h)] return files_belong_to_same_module, common_path def UpdateIncludeState(filename, include_dict, io=codecs): """Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was successfully added. False otherwise. """ headerfile = None try: with io.open(filename, 'r', 'utf8', 'replace') as headerfile: linenum = 0 for line in headerfile: linenum += 1 clean_line = CleanseComments(line) match = _RE_PATTERN_INCLUDE.search(clean_line) if match: include = match.group(2) include_dict.setdefault(include, linenum) return True except IOError: return False def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, io=codecs): """Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one reason to include a header. For example, if you use both equal_to<> and less<> in a .h file, only one (the latter in the file) of these will be reported as a reason to include the . Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. include_state: An _IncludeState instance. error: The function to call with any errors found. io: The IO factory to use to read the header file. Provided for unittest injection. """ required = {} # A map of header name to linenumber and the template entity. # Example of required: { '': (1219, 'less<>') } for linenum in xrange(clean_lines.NumLines()): line = clean_lines.elided[linenum] if not line or line[0] == '#': continue # String is special -- it is a non-templatized type in STL. matched = _RE_PATTERN_STRING.search(line) if matched: # Don't warn about strings 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[''] = (linenum, 'string') for pattern, template, header in _re_pattern_headers_maybe_templates: if pattern.search(line): required[header] = (linenum, template) # The following function is just a speed up, no semantics are changed. if not '<' in line: # Reduces the cpu time usage by skipping lines. continue for pattern, template, header in _re_pattern_templates: 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. # Let's flatten the include_state include_list and copy it into a dictionary. include_dict = dict([item for sublist in include_state.include_list for item in sublist]) # Did we find the header for this file (if any) and successfully load it? header_found = False # Use the absolute path so that matching works properly. abs_filename = FileInfo(filename).FullName() # For Emacs's flymake. # If cpplint is invoked from Emacs's flymake, a temporary file is generated # by flymake and that file name might end with '_flymake.cc'. In that case, # restore original file name here so that the corresponding header file can be # found. # e.g. If the file name is 'foo_flymake.cc', we should search for 'foo.h' # instead of 'foo_flymake.h' abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename) # include_dict is modified during iteration, so we iterate over a copy of # the keys. header_keys = list(include_dict.keys()) for header in header_keys: (same_module, common_path) = FilesBelongToSameModule(abs_filename, header) fullpath = common_path + header if same_module and UpdateIncludeState(fullpath, include_dict, io): header_found = True # If we can't find the header file for a .cc, assume it's because we don't # know where to look. In that case we'll give up as we're not sure they # 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 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 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], 'build/include_what_you_use', 4, 'Add #include ' + required_header_unstripped + ' for ' + template) _RE_PATTERN_EXPLICIT_MAKEPAIR = re.compile(r'\bmake_pair\s*<') def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): """Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. 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] match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line) if match: error(filename, linenum, 'build/explicit_make_pair', 4, # 4 = high confidence 'For C++11-compatibility, omit template arguments from make_pair' ' OR use pair directly OR if appropriate, construct a pair directly') def CheckRedundantVirtual(filename, clean_lines, linenum, error): """Check if line contains a redundant "virtual" function-specifier. 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. """ # Look for "virtual" on current line. line = clean_lines.elided[linenum] virtual = Match(r'^(.*)(\bvirtual\b)(.*)$', line) if not virtual: return # Ignore "virtual" keywords that are near access-specifiers. These # are only used in class base-specifier and do not apply to member # functions. if (Search(r'\b(public|protected|private)\s+$', virtual.group(1)) or Match(r'^\s+(public|protected|private)\b', virtual.group(3))): return # Ignore the "virtual" keyword from virtual base classes. Usually # there is a column on the same line in these cases (virtual base # classes are rare in google3 because multiple inheritance is rare). if Match(r'^.*[^:]:[^:].*$', line): return # Look for the next opening parenthesis. This is the start of the # parameter list (possibly on the next line shortly after virtual). # TODO(unknown): doesn't work if there are virtual functions with # decltype() or other things that use parentheses, but csearch suggests # that this is rare. end_col = -1 end_line = -1 start_col = len(virtual.group(2)) for start_line in xrange(linenum, min(linenum + 3, clean_lines.NumLines())): line = clean_lines.elided[start_line][start_col:] parameter_list = Match(r'^([^(]*)\(', line) if parameter_list: # Match parentheses to find the end of the parameter list (_, end_line, end_col) = CloseExpression( clean_lines, start_line, start_col + len(parameter_list.group(1))) break start_col = 0 if end_col < 0: return # Couldn't find end of parameter list, give up # Look for "override" or "final" after the parameter list # (possibly on the next few lines). for i in xrange(end_line, min(end_line + 3, clean_lines.NumLines())): line = clean_lines.elided[i][end_col:] match = Search(r'\b(override|final)\b', line) if match: error(filename, linenum, 'readability/inheritance', 4, ('"virtual" is redundant since function is ' 'already declared as "%s"' % match.group(1))) # Set end_col to check whole lines after we are done with the # first line. end_col = 0 if Search(r'[^\w]\s*$', line): break def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): """Check if line contains a redundant "override" or "final" virt-specifier. 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. """ # Look for closing parenthesis nearby. We need one to confirm where # the declarator ends and where the virt-specifier starts to avoid # false positives. line = clean_lines.elided[linenum] declarator_end = line.rfind(')') if declarator_end >= 0: fragment = line[declarator_end:] else: if linenum > 1 and clean_lines.elided[linenum - 1].rfind(')') >= 0: fragment = line else: return # Check that at most one of "override" or "final" is present, not both if Search(r'\boverride\b', fragment) and Search(r'\bfinal\b', fragment): error(filename, linenum, 'readability/inheritance', 4, ('"override" is redundant since function is ' 'already declared as "final"')) # Returns true if we are at a new block, and it is directly # inside of a namespace. def IsBlockInNameSpace(nesting_state, is_forward_declaration): """Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new block is directly in a namespace. """ if is_forward_declaration: 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 isinstance(nesting_state.stack[-2], _NamespaceInfo)) def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, raw_lines_no_comments, linenum): """This method determines if we should apply our namespace indentation check. Args: nesting_state: The current nesting state. is_namespace_indent_item: If we just put a new class on the stack, True. If the top of the stack is not a class, or we did not recently add the class, False. raw_lines_no_comments: The lines without the comments. linenum: The current line number we are processing. Returns: True if we should apply our namespace indentation check. Currently, it only works for classes and namespaces inside of a namespace. """ is_forward_declaration = IsForwardClassDeclaration(raw_lines_no_comments, linenum) if not (is_namespace_indent_item or is_forward_declaration): return False # If we are in a macro, we do not want to check the namespace indentation. if IsMacroDefinition(raw_lines_no_comments, linenum): return False return IsBlockInNameSpace(nesting_state, is_forward_declaration) # Call this method if the line is directly inside of a namespace. # If the line above is blank (excluding comments) or the start of # an inner namespace, it cannot be indented. def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum, error): line = raw_lines_no_comments[linenum] if Match(r'^\s+', line): error(filename, linenum, 'runtime/indentation_namespace', 4, 'Do not indent within a namespace') def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=None): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being processed. include_state: An _IncludeState instance in which the headers are inserted. function_state: A _FunctionState instance which counts function lines, etc. nesting_state: A NestingState instance which maintains information about the current stack of nested blocks being parsed. error: A callable to which errors are reported, which takes 4 arguments: filename, line number, error level, and message extra_check_functions: An array of additional check functions that will be run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error """ raw_lines = clean_lines.raw_lines ParseNolintSuppressions(filename, raw_lines[line], line, error) nesting_state.Update(filename, clean_lines, line, error) CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, error) if nesting_state.InAsmBlock(): return CheckForFunctionLengths(filename, clean_lines, line, function_state, error) CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error) CheckLanguage(filename, clean_lines, line, file_extension, include_state, nesting_state, error) CheckForNonConstReference(filename, clean_lines, line, nesting_state, error) CheckForNonStandardConstructs(filename, clean_lines, line, nesting_state, error) CheckVlogArguments(filename, clean_lines, line, error) CheckPosixThreading(filename, clean_lines, line, error) CheckInvalidIncrement(filename, clean_lines, line, error) CheckMakePairUsesDeduction(filename, clean_lines, line, error) CheckRedundantVirtual(filename, clean_lines, line, error) CheckRedundantOverrideOrFinal(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. 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++ 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', 'future', 'mutex', 'thread', 'chrono', 'ratio', 'regex', 'system_error', ): error(filename, linenum, 'build/c++11', 5, ('<%s> is an unapproved C++11 header.') % include.group(1)) # The only place where we need to worry about C++11 keywords and library # features in preprocessor directives is in macro definitions. if Match(r'\s*#', line) and not Match(r'\s*#\s*define\b', line): return # These are classes and free functions. The classes are always # mentioned as std::*, but we only catch the free functions if # they're not found by ADL. They're alphabetical by header. for top_name in ( # type_traits 'alignment_of', 'aligned_union', ): if Search(r'\bstd::%s\b' % top_name, line): error(filename, linenum, 'build/c++11', 5, ('std::%s is an unapproved C++11 class or function. Send c-style ' 'an example of where it would make your code more readable, and ' '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=None): """Performs lint checks and reports any errors to the given error function. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. 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. error: A callable to which errors are reported, which takes 4 arguments: filename, line number, error level, and message extra_check_functions: An array of additional check functions that will be run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error """ lines = (['// marker so line numbers and indices both start at 1'] + lines + ['// marker so line numbers end in a known way']) include_state = _IncludeState() function_state = _FunctionState() nesting_state = NestingState() ResetNolintSuppressions() CheckForCopyright(filename, lines, error) ProcessGlobalSuppresions(lines) RemoveMultiLineComments(filename, lines, error) clean_lines = CleansedLines(lines) if IsHeaderExtension(file_extension): CheckForHeaderGuard(filename, clean_lines, error) for line in xrange(clean_lines.NumLines()): ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions) FlagCxx11Features(filename, clean_lines, line, 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 _IsSourceExtension(file_extension): CheckHeaderFileIncluded(filename, include_state, error) # We check here rather than inside ProcessLine so that we see raw # lines rather than "cleaned" lines. CheckForBadCharacters(filename, lines, error) CheckForNewlineAtEOF(filename, lines, error) def ProcessConfigOverrides(filename): """ Loads the configuration files and processes the config overrides. Args: filename: The name of the file being processed by the linter. Returns: False if the current |filename| should not be processed further. """ abs_filename = os.path.abspath(filename) cfg_filters = [] keep_looking = True while keep_looking: abs_path, base_name = os.path.split(abs_filename) if not base_name: break # Reached the root directory. cfg_file = os.path.join(abs_path, "CPPLINT.cfg") abs_filename = abs_path if not os.path.isfile(cfg_file): continue try: with open(cfg_file) as file_handle: for line in file_handle: line, _, _ = line.partition('#') # Remove comments. if not line.strip(): continue name, _, val = line.partition('=') name = name.strip() val = val.strip() if name == 'set noparent': keep_looking = False elif name == 'filter': cfg_filters.append(val) elif name == 'exclude_files': # When matching exclude_files pattern, use the base_name of # the current file name or the directory name we are processing. # For example, if we are checking for lint errors in /foo/bar/baz.cc # and we found the .cfg file at /foo/CPPLINT.cfg, then the config # file's "exclude_files" filter is meant to be checked against "bar" # and not "baz" nor "bar/baz.cc". if base_name: pattern = re.compile(val) if pattern.match(base_name): 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)) return False elif name == 'linelength': global _line_length try: _line_length = int(val) except ValueError: _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) elif name == 'includeorder': ProcessIncludeOrderOption(val) else: _cpplint_state.PrintError( 'Invalid configuration option (%s) in file %s\n' % (name, cfg_file)) except IOError: _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 cfg_filter in reversed(cfg_filters): _AddFilters(cfg_filter) return True def ProcessFile(filename, vlevel, extra_check_functions=None): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error """ _SetVerboseLevel(vlevel) _BackupFilters() old_errors = _cpplint_state.error_count if not ProcessConfigOverrides(filename): _RestoreFilters() return lf_lines = [] crlf_lines = [] try: # Support the UNIX convention of using "-" for stdin. Note that # we are not opening the file with universal newline support # (which codecs doesn't support anyway), so the resulting lines do # contain trailing '\r' characters if we are reading a file that # has CRLF endings. # If after the split a trailing '\r' is present, it is removed # below. if filename == '-': lines = codecs.StreamReaderWriter(sys.stdin, codecs.getreader('utf8'), codecs.getwriter('utf8'), 'replace').read().split('\n') else: with codecs.open(filename, 'r', 'utf8', 'replace') as target_file: lines = target_file.read().split('\n') # Remove trailing '\r'. # The -1 accounts for the extra trailing blank line we get from split() for linenum in range(len(lines) - 1): if lines[linenum].endswith('\r'): lines[linenum] = lines[linenum].rstrip('\r') crlf_lines.append(linenum + 1) else: lf_lines.append(linenum + 1) except IOError: _cpplint_state.PrintError( "Skipping input '%s': Can't open for reading\n" % filename) _RestoreFilters() return # Note, if no dot is found, this will give the entire filename as the ext. file_extension = filename[filename.rfind('.') + 1:] # When reading from stdin, the extension is unknown, so no cpplint tests # should rely on the extension. 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) # If end-of-line sequences are a mix of LF and CR-LF, issue # warnings on the lines with CR. # # Don't issue any warnings if all lines are uniformly LF or CR-LF, # since critique can handle these just fine, and the style guide # doesn't dictate a particular end of line sequence. # # We can't depend on os.linesep to determine what the desired # end-of-line sequence should be, since that will return the # server-side end-of-line sequence. if lf_lines and crlf_lines: # Warn on every line with CR. An alternative approach might be to # check whether the file is mostly CRLF or just LF, and warn on the # minority, we bias toward LF here since most tools prefer LF. for linenum in crlf_lines: Error(filename, linenum, 'whitespace/newline', 1, 'Unexpected \\r (^M) found; better to use only \\n') # 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() def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE % (sorted(list(GetAllExtensions())), ','.join(sorted(list(GetAllExtensions()))), sorted(GetHeaderExtensions()), ','.join(sorted(GetHeaderExtensions())))) if message: sys.exit('\nFATAL ERROR: ' + message) else: 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. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0) def ParseArguments(args): """Parses the command line arguments. This may set the output format and verbosity level as side-effects. Args: args: The command line arguments: Returns: The list of filenames to lint. """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', 'v=', 'version', 'counting=', 'filter=', 'root=', 'repository=', 'linelength=', 'extensions=', 'exclude=', 'recursive', 'headers=', 'includeorder=', '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', 'junit', 'sed', 'gsed'): PrintUsage('The only allowed output formats are emacs, vs7, eclipse ' 'sed, gsed and junit.') output_format = val elif opt == '--quiet': quiet = True elif opt == '--verbose' or opt == '--v': verbosity = int(val) elif opt == '--filter': filters = val if not filters: PrintCategories() elif opt == '--counting': if val not in ('total', 'toplevel', 'detailed'): PrintUsage('Valid counting options are total, toplevel, and detailed') counting_style = val 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) except ValueError: PrintUsage('Line length must be digits.') elif opt == '--exclude': global _excludes if not _excludes: _excludes = set() _excludes.update(glob.glob(val)) elif opt == '--extensions': ProcessExtensionsOption(val) elif opt == '--headers': ProcessHppHeadersOption(val) elif opt == '--recursive': recursive = True elif opt == '--includeorder': ProcessIncludeOrderOption(val) 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) filenames.sort() 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. Args: filenames: A list of files or directories Returns: A list of all files that are members of filenames or descended from a directory in filenames """ expanded = set() for filename in filenames: 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) if __name__ == '__main__': main() cpplint-1.5.5/cpplint_clitest.py000077500000000000000000000174701405143476300167700ustar00rootroot00000000000000#!/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 from testfixtures import compare 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, then the line count of stdout lines, then the stdout lines, 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 = os.path.realpath(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(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, definition_file, args, expected_status, expected_out, expected_err ): rel_cwd = os.path.dirname(definition_file) 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) self.assertEqual(expected_status, status, 'bad command status %s' % status) prefix = 'Failed check in %s comparing to %s for command: %s' % (cwd, definition_file, cmd) compare('\n'.join(expected_err), err.decode('utf8'), prefix=prefix, show_whitespace=True) compare('\n'.join(expected_out), out.decode('utf8'), prefix=prefix, show_whitespace=True) 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', 4) def testBoostSample(self): self.checkAllInFolder('./samples/boost-sample', 4) def testProtobufSample(self): self.checkAllInFolder('./samples/protobuf-sample', 1) def testCodeliteSample(self): self.checkAllInFolder('./samples/codelite-sample', 1) def testV8Sample(self): self.checkAllInFolder('./samples/v8-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() cpplint-1.5.5/cpplint_unittest.py000077500000000000000000010107021405143476300171700ustar00rootroot00000000000000#!/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. """Unit test for cpplint.py.""" # TODO(unknown): Add a good test that tests UpdateIncludeState. import codecs 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 # is in cpplint._ERROR_CATEGORIES, to help keep that list up to date. class ErrorCollector(object): # These are a global list, covering all categories seen ever. _ERROR_CATEGORIES = cpplint._ERROR_CATEGORIES _SEEN_ERROR_CATEGORIES = {} def __init__(self, assert_fn): """assert_fn: a function to call when we notice a problem.""" self._assert_fn = assert_fn self._errors = [] cpplint.ResetNolintSuppressions() def __call__(self, unused_filename, linenum, category, confidence, message): self._assert_fn(category in self._ERROR_CATEGORIES, 'Message "%s" has category "%s",' ' which is not in _ERROR_CATEGORIES' % (message, category)) self._SEEN_ERROR_CATEGORIES[category] = 1 if cpplint._ShouldPrintError(category, confidence, linenum): self._errors.append('%s [%s] [%d]' % (message, category, confidence)) def Results(self): if len(self._errors) < 2: return ''.join(self._errors) # Most tests expect to have a string. else: return self._errors # Let's give a list if there is more than one. def ResultList(self): return self._errors def VerifyAllCategoriesAreSeen(self): """Fails if there's a category in _ERROR_CATEGORIES~_SEEN_ERROR_CATEGORIES. This should only be called after all tests are run, so _SEEN_ERROR_CATEGORIES has had a chance to fully populate. Since this isn't called from within the normal unittest framework, we can't use the normal unittest assert macros. Instead we just exit when we see an error. Good thing this test is always run last! """ for category in self._ERROR_CATEGORIES: if category not in self._SEEN_ERROR_CATEGORIES: sys.exit('FATAL ERROR: There are no tests for category "%s"' % category) def RemoveIfPresent(self, substr): for (index, error) in enumerate(self._errors): if error.find(substr) != -1: self._errors = self._errors[0:index] + self._errors[(index + 1):] break # This class is a lame mock of codecs. We do not verify filename, mode, or # encoding, but for the current use case it is not needed. class MockIo(object): def __init__(self, mock_file): # wrap list to allow "with open(mock)" class EnterableList(list): def __enter__(self): return self def __exit__(self, type, value, tb): return self self.mock_file = EnterableList(mock_file) def open(self, # pylint: disable=C6409 unused_filename, unused_mode, unused_encoding, _): return self.mock_file class CpplintTestBase(unittest.TestCase): """Provides some useful helper functions for cpplint tests.""" def setUp(self): # Allow subclasses to cheat os.path.abspath called in FileInfo class. self.os_path_abspath_orig = os.path.abspath def tearDown(self): os.path.abspath = self.os_path_abspath_orig # Perform lint on single line of input and return the error message. def PerformSingleLineLint(self, code): error_collector = ErrorCollector(self.assert_) lines = code.split('\n') cpplint.RemoveMultiLineComments('foo.h', lines, error_collector) clean_lines = cpplint.CleansedLines(lines) include_state = cpplint._IncludeState() function_state = cpplint._FunctionState() nesting_state = cpplint.NestingState() cpplint.ProcessLine('foo.cc', 'cc', clean_lines, 0, include_state, function_state, nesting_state, error_collector) # Single-line lint tests are allowed to fail the 'unlintable function' # check. error_collector.RemoveIfPresent( 'Lint failed to find start of function body.') return error_collector.Results() # Perform lint over multiple lines and return the error message. def PerformMultiLineLint(self, code): error_collector = ErrorCollector(self.assert_) lines = code.split('\n') cpplint.RemoveMultiLineComments('foo.h', lines, error_collector) lines = cpplint.CleansedLines(lines) nesting_state = cpplint.NestingState() for i in xrange(lines.NumLines()): nesting_state.Update('foo.h', lines, i, error_collector) cpplint.CheckStyle('foo.h', lines, i, 'h', nesting_state, error_collector) cpplint.CheckForNonStandardConstructs('foo.h', lines, i, nesting_state, error_collector) nesting_state.CheckCompletedBlocks('foo.h', error_collector) return error_collector.Results() # Similar to PerformMultiLineLint, but calls CheckLanguage instead of # CheckForNonStandardConstructs def PerformLanguageRulesCheck(self, file_name, code): error_collector = ErrorCollector(self.assert_) include_state = cpplint._IncludeState() nesting_state = cpplint.NestingState() lines = code.split('\n') cpplint.RemoveMultiLineComments(file_name, lines, error_collector) lines = cpplint.CleansedLines(lines) ext = file_name[file_name.rfind('.') + 1:] for i in xrange(lines.NumLines()): cpplint.CheckLanguage(file_name, lines, i, ext, include_state, nesting_state, error_collector) return error_collector.Results() def PerformFunctionLengthsCheck(self, code): """Perform Lint function length check on block of code and return warnings. Builds up an array of lines corresponding to the code and strips comments using cpplint functions. Establishes an error collector and invokes the function length checking function following cpplint's pattern. Args: code: C++ source code expected to generate a warning message. Returns: The accumulated errors. """ file_name = 'foo.cc' error_collector = ErrorCollector(self.assert_) function_state = cpplint._FunctionState() lines = code.split('\n') cpplint.RemoveMultiLineComments(file_name, lines, error_collector) lines = cpplint.CleansedLines(lines) for i in xrange(lines.NumLines()): cpplint.CheckForFunctionLengths(file_name, lines, i, function_state, error_collector) return error_collector.Results() def PerformIncludeWhatYouUse(self, code, filename='foo.h', io=codecs): # First, build up the include state. error_collector = ErrorCollector(self.assert_) include_state = cpplint._IncludeState() nesting_state = cpplint.NestingState() lines = code.split('\n') cpplint.RemoveMultiLineComments(filename, lines, error_collector) lines = cpplint.CleansedLines(lines) for i in xrange(lines.NumLines()): cpplint.CheckLanguage(filename, lines, i, '.h', include_state, nesting_state, error_collector) # We could clear the error_collector here, but this should # also be fine, since our IncludeWhatYouUse unittests do not # have language problems. # Second, look for missing includes. cpplint.CheckForIncludeWhatYouUse(filename, lines, include_state, error_collector, io) return error_collector.Results() # Perform lint and compare the error message with "expected_message". def TestLint(self, code, expected_message): self.assertEquals(expected_message, self.PerformSingleLineLint(code)) def TestMultiLineLint(self, code, expected_message): self.assertEquals(expected_message, self.PerformMultiLineLint(code)) def TestMultiLineLintRE(self, code, expected_message_re): message = self.PerformMultiLineLint(code) if not re.search(expected_message_re, message): self.fail('Message was:\n' + message + 'Expected match to "' + expected_message_re + '"') def TestLanguageRulesCheck(self, file_name, code, expected_message): self.assertEquals(expected_message, self.PerformLanguageRulesCheck(file_name, code)) def TestIncludeWhatYouUse(self, code, expected_message): self.assertEquals(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.' + extension, extension, lines, error_collector) self.assertEquals( start_errors, error_collector.Results().count( 'Redundant blank line at the start of a code block ' 'should be deleted. [whitespace/blank_line] [2]')) self.assertEquals( end_errors, error_collector.Results().count( 'Redundant blank line at the end of a code block ' 'should be deleted. [whitespace/blank_line] [3]')) class CpplintTest(CpplintTestBase): def GetNamespaceResults(self, lines): error_collector = ErrorCollector(self.assert_) cpplint.RemoveMultiLineComments('foo.h', lines, error_collector) lines = cpplint.CleansedLines(lines) nesting_state = cpplint.NestingState() for i in xrange(lines.NumLines()): nesting_state.Update('foo.h', lines, i, error_collector) cpplint.CheckForNamespaceIndentation('foo.h', nesting_state, lines, i, error_collector) return error_collector.Results() def testForwardDeclarationNameSpaceIndentation(self): lines = ['namespace Test {', ' class ForwardDeclaration;', '} // namespace Test'] results = self.GetNamespaceResults(lines) self.assertEquals(results, 'Do not indent within a namespace ' ' [runtime/indentation_namespace] [4]') def testNameSpaceIndentationForClass(self): lines = ['namespace Test {', 'void foo() { }', ' class Test {', ' };', '} // namespace Test'] results = self.GetNamespaceResults(lines) self.assertEquals(results, 'Do not indent within a namespace ' ' [runtime/indentation_namespace] [4]') def testNameSpaceIndentationNoError(self): lines = ['namespace Test {', 'void foo() { }', '} // namespace Test'] 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 {', ' struct NoFalsePositivesHere;', ' struct NoFalsePositivesHere member_variable;', '};', '} // namespace Test'] results = self.GetNamespaceResults(lines) self.assertEquals(results, '') # Test get line width. def testGetLineWidth(self): self.assertEquals(0, cpplint.GetLineWidth('')) 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\(')) self.assertEquals('x, y', cpplint._GetTextInside('f(x, y)', r'f\(')) self.assertEquals('a(), b(c())', cpplint._GetTextInside( 'printf(a(), b(c()))', r'printf\(')) self.assertEquals('x, y{}', cpplint._GetTextInside('f[x, y{}]', r'f\[')) self.assertEquals(None, cpplint._GetTextInside('f[a, b(}]', r'f\[')) self.assertEquals(None, cpplint._GetTextInside('f[x, y]', r'f\(')) self.assertEquals('y, h(z, (a + b))', cpplint._GetTextInside( 'f(x, g(y, h(z, (a + b))))', r'g\(')) self.assertEquals('f(f(x))', cpplint._GetTextInside('f(f(f(x)))', r'f\(')) # Supports multiple lines. self.assertEquals('\n return loop(x);\n', cpplint._GetTextInside( 'int loop(int x) {\n return loop(x);\n}\n', r'\{')) # '^' matches the beginning of each line. self.assertEquals('x, y', cpplint._GetTextInside( '#include "inl.h" // skip #define\n' '#define A2(x, y) a_inl_(x, y, __LINE__)\n' '#define A(x) a_inl_(x, "", __LINE__)\n', r'^\s*#define\s*\w+\(')) def testFindNextMultiLineCommentStart(self): self.assertEquals(1, cpplint.FindNextMultiLineCommentStart([''], 0)) lines = ['a', 'b', '/* c'] self.assertEquals(2, cpplint.FindNextMultiLineCommentStart(lines, 0)) lines = ['char a[] = "/*";'] # not recognized as comment. self.assertEquals(1, cpplint.FindNextMultiLineCommentStart(lines, 0)) def testFindNextMultiLineCommentEnd(self): self.assertEquals(1, cpplint.FindNextMultiLineCommentEnd([''], 0)) lines = ['a', 'b', ' c */'] self.assertEquals(2, cpplint.FindNextMultiLineCommentEnd(lines, 0)) def testRemoveMultiLineCommentsFromRange(self): lines = ['a', ' /* comment ', ' * still comment', ' comment */ ', 'b'] cpplint.RemoveMultiLineCommentsFromRange(lines, 1, 4) self.assertEquals(['a', '/**/', '/**/', '/**/', 'b'], lines) def testSpacesAtEndOfLine(self): self.TestLint( '// Hello there ', 'Line ends in whitespace. Consider deleting these extra spaces.' ' [whitespace/end_of_line] [4]') # Test line length check. def testLineLengthCheck(self): self.TestLint( '// Hello', '') self.TestLint( '// x' + ' x' * 40, 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') self.TestLint( '// 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/', '') self.TestLint( '// https://g' + ('o' * 100) + 'gle.com/', '') self.TestLint( '// https://g' + ('o' * 60) + 'gle.com/ and some comments', 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') self.TestLint( '// Read https://g' + ('o' * 60) + 'gle.com/', '') self.TestLint( '// $Id: g' + ('o' * 80) + 'gle.cc#1 $', '') self.TestLint( '// $Id: g' + ('o' * 80) + 'gle.cc#1', 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') self.TestMultiLineLint( 'static const char kCStr[] = "g' + ('o' * 50) + 'gle";\n', 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') self.TestMultiLineLint( 'static const char kRawStr[] = R"(g' + ('o' * 50) + 'gle)";\n', '') # no warning because raw string content is elided self.TestMultiLineLint( 'static const char kMultiLineRawStr[] = R"(\n' 'g' + ('o' * 80) + 'gle\n' ')";', '') self.TestMultiLineLint( '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): # Two errors on same line: self.TestLint( 'long a = (int64) 65;', ['Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]', 'Use int16/int64/etc, rather than the C type long' ' [runtime/int] [4]', ]) # One category of error suppressed: self.TestLint( 'long a = (int64) 65; // NOLINT(runtime/int)', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') # All categories suppressed: (two aliases) self.TestLint('long a = (int64) 65; // NOLINT', '') self.TestLint('long a = (int64) 65; // NOLINT(*)', '') # Malformed NOLINT directive: self.TestLint( 'long a = 65; // NOLINT(foo)', ['Unknown NOLINT error category: foo' ' [readability/nolint] [5]', 'Use int16/int64/etc, rather than the C type long [runtime/int] [4]', ]) # Irrelevant NOLINT directive has no effect: self.TestLint( 'long a = 65; // NOLINT(readability/casting)', 'Use int16/int64/etc, rather than the C type long' ' [runtime/int] [4]') # NOLINTNEXTLINE silences warning for the next line instead of current line error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('test.cc', 'cc', ['// Copyright 2014 Your Company.', '// NOLINTNEXTLINE(whitespace/line_length)', '// ./command' + (' -verbose' * 80), ''], 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): self.TestLint( 'long a = 65;', 'Use int16/int64/etc, rather than the C type long' ' [runtime/int] [4]') self.TestLint( 'long double b = 65.0;', '') self.TestLint( 'long long aa = 6565;', 'Use int16/int64/etc, rather than the C type long' ' [runtime/int] [4]') # Test C-style cast cases. def testCStyleCast(self): self.TestLint( 'int a = (int)1.0;', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') self.TestLint( 'int a = (int)-1.0;', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') self.TestLint( 'int *a = (int *)NULL;', 'Using C-style cast. Use reinterpret_cast(...) instead' ' [readability/casting] [4]') self.TestLint( 'uint16 a = (uint16)1.0;', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') self.TestLint( 'int32 a = (int32)1.0;', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') self.TestLint( 'uint64 a = (uint64)1.0;', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') self.TestLint( 'size_t a = (size_t)1.0;', 'Using C-style cast. Use static_cast(...) instead' ' [readability/casting] [4]') # These shouldn't be recognized casts. self.TestLint('u a = (u)NULL;', '') self.TestLint('uint a = (uint)NULL;', '') self.TestLint('typedef MockCallback CallbackType;', '') self.TestLint('scoped_ptr< MockCallback > callback_value;', '') self.TestLint('std::function', '') self.TestLint('x = sizeof(int)', '') self.TestLint('x = alignof(int)', '') self.TestLint('alignas(int) char x[42]', '') self.TestLint('alignas(alignof(x)) char y[42]', '') self.TestLint('void F(int (func)(int));', '') self.TestLint('void F(int (func)(int*));', '') self.TestLint('void F(int (Class::member)(int));', '') self.TestLint('void F(int (Class::member)(int*));', '') self.TestLint('void F(int (Class::member)(int), int param);', '') self.TestLint('void F(int (Class::member)(int*), int param);', '') # These should not be recognized (lambda functions without arg names). self.TestLint('[](int/*unused*/) -> bool {', '') self.TestLint('[](int /*unused*/) -> bool {', '') self.TestLint('auto f = [](MyStruct* /*unused*/)->int {', '') 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): error_msg = ('Are you taking an address of a cast? ' 'This is dangerous: could be a temp var. ' 'Take the address before doing the cast, rather than after' ' [runtime/casting] [4]') self.TestLint('int* x = &static_cast(foo);', error_msg) self.TestLint('int* x = &reinterpret_cast(foo);', error_msg) self.TestLint('int* x = &(int*)foo;', ['Using C-style cast. Use reinterpret_cast(...) ' 'instead [readability/casting] [4]', error_msg]) self.TestLint('BudgetBuckets&(BudgetWinHistory::*BucketFn)(void) const;', '') self.TestLint('&(*func_ptr)(arg)', '') self.TestLint('Compute(arg, &(*func_ptr)(i, j));', '') # Alternative error message alt_error_msg = ('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]') self.TestLint('int* x = &down_cast(obj)->member_;', alt_error_msg) self.TestLint('int* x = &down_cast(obj)[index];', alt_error_msg) self.TestLint('int* x = &(down_cast(obj)->member_);', '') self.TestLint('int* x = &(down_cast(obj)[index]);', '') self.TestLint('int* x = &down_cast(obj)\n->member_;', alt_error_msg) self.TestLint('int* x = &(down_cast(obj)\n->member_);', '') # It's OK to cast an address. self.TestLint('int* x = reinterpret_cast(&foo);', '') # Function pointers returning references should not be confused # with taking address of old-style casts. self.TestLint('auto x = implicit_cast(&foo);', '') def testRuntimeSelfinit(self): self.TestLint( '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) { }', '') self.TestLint( 'Foo::Foo(Bar r) : r_(r), l_(r_), ll_(l_) { }', '') # Test for unnamed arguments in a method. def testCheckForUnnamedParams(self): 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();', '') self.TestLint('void Method(char* x) {', '') self.TestLint('void Method(char* /*x*/) {', '') self.TestLint('void Method(char* x);', '') self.TestLint('typedef void (*Method)(int32 x);', '') self.TestLint('static void operator delete[](void* x) throw();', '') self.TestLint('static void operator delete[](void* /*x*/) throw();', '') self.TestLint('X operator++(int);', '') self.TestLint('X operator++(int) {', '') self.TestLint('X operator--(int);', '') self.TestLint('X operator--(int /*unused*/) {', '') self.TestLint('MACRO(int);', '') self.TestLint('MACRO(func(int));', '') self.TestLint('MACRO(arg, func(int));', '') self.TestLint('void (*func)(void*);', '') self.TestLint('void Func((*func)(void*)) {}', '') self.TestLint('template void func();', '') self.TestLint('virtual void f(int /*unused*/) {', '') self.TestLint('void f(int /*unused*/) override {', '') self.TestLint('void f(int /*unused*/) final {', '') # Test deprecated casts such as int(d) def testDeprecatedCast(self): self.TestLint( 'int a = int(2.2);', 'Using deprecated casting style. ' 'Use static_cast(...) instead' ' [readability/casting] [4]') self.TestLint( '(char *) "foo"', 'Using C-style cast. ' 'Use const_cast(...) instead' ' [readability/casting] [4]') self.TestLint( '(int*)foo', 'Using C-style cast. ' 'Use reinterpret_cast(...) instead' ' [readability/casting] [4]') # Checks for false positives... self.TestLint('int a = int();', '') # constructor self.TestLint('X::X() : a(int()) {}', '') # default constructor 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 # Placement new self.TestLint( 'new(field_ptr) int(field->default_value_enum()->number());', '') # C++11 function wrappers self.TestLint('std::function', '') self.TestLint('std::function', '') self.TestLint('std::function< int(bool) >', '') self.TestLint('mfunction', '') error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'test.cc', 'cc', ['// Copyright 2014 Your Company. All Rights Reserved.', 'typedef std::function<', ' bool(int)> F;', ''], error_collector) self.assertEquals('', error_collector.Results()) # Return types for function pointers self.TestLint('typedef bool(FunctionPointer)();', '') self.TestLint('typedef bool(FunctionPointer)(int param);', '') self.TestLint('typedef bool(MyClass::*MemberFunctionPointer)();', '') self.TestLint('typedef bool(MyClass::* MemberFunctionPointer)();', '') self.TestLint('typedef bool(MyClass::*MemberFunctionPointer)() const;', '') self.TestLint('void Function(bool(FunctionPointerArg)());', '') self.TestLint('void Function(bool(FunctionPointerArg)()) {}', '') self.TestLint('typedef set SortedIdSet', '') self.TestLint( 'bool TraverseNode(T *Node, bool(VisitorBase:: *traverse) (T *t)) {}', '') # The second parameter to a gMock method definition is a function signature # that often looks like a bad cast but should not picked up by lint. def testMockMethod(self): self.TestLint( 'MOCK_METHOD0(method, int());', '') self.TestLint( 'MOCK_CONST_METHOD1(method, float(string));', '') self.TestLint( 'MOCK_CONST_METHOD2_T(method, double(float, float));', '') self.TestLint( 'MOCK_CONST_METHOD1(method, SomeType(int));', '') error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('mock.cc', 'cc', ['MOCK_METHOD1(method1,', ' bool(int));', 'MOCK_METHOD1(', ' method2,', ' bool(int));', 'MOCK_CONST_METHOD2(', ' method3, bool(int,', ' int));', 'MOCK_METHOD1(method4, int(bool));', 'const int kConstant = int(42);'], # true positive error_collector) self.assertEquals( 0, error_collector.Results().count( ('Using deprecated casting style. ' 'Use static_cast(...) instead ' '[readability/casting] [4]'))) self.assertEquals( 1, error_collector.Results().count( ('Using deprecated casting style. ' 'Use static_cast(...) instead ' '[readability/casting] [4]'))) # Like gMock method definitions, MockCallback instantiations look very similar # to bad casts. def testMockCallback(self): self.TestLint( 'MockCallback', '') self.TestLint( 'MockCallback', '') # Test false errors that happened with some include file names def testIncludeFilenameFalseError(self): self.TestLint( '#include "foo/long-foo.h"', '') self.TestLint( '#include "foo/sprintf.h"', '') # Test typedef cases. There was a bug that cpplint misidentified # typedef for pointer to function as C-style cast and produced # false-positive error messages. def testTypedefForPointerToFunction(self): self.TestLint( 'typedef void (*Func)(int x);', '') self.TestLint( 'typedef void (*Func)(int *x);', '') self.TestLint( 'typedef void Func(int x);', '') self.TestLint( 'typedef void Func(int *x);', '') def testIncludeWhatYouUseNoImplementationFiles(self): code = 'std::vector foo;' 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( """#include std::vector foo; """, '') self.TestIncludeWhatYouUse( """#include std::pair foo; """, 'Add #include for pair<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include std::pair foo; """, 'Add #include for pair<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include std::pair foo; """, '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; """, '') self.TestIncludeWhatYouUse( """#include DECLARE_string(foobar); """, '') self.TestIncludeWhatYouUse( """#include DEFINE_string(foobar, "", ""); """, '') self.TestIncludeWhatYouUse( """#include std::pair foo; """, 'Add #include for pair<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include "base/foobar.h" std::vector foo; """, 'Add #include for vector<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include std::set foo; """, 'Add #include for set<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include "base/foobar.h" hash_map foobar; """, '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); """, 'Add #include for less<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include "base/foobar.h" bool foobar = min(0,1); """, 'Add #include for min [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( 'void a(const string &foobar);', 'Add #include for string [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( 'void a(const std::string &foobar);', 'Add #include for string [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( 'void a(const my::string &foobar);', '') # Avoid false positives on strings in other namespaces. self.TestIncludeWhatYouUse( """#include "base/foobar.h" bool foobar = swap(0,1); """, '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); """, 'Add #include for transform ' '[build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include "base/foobar.h" bool foobar = min_element(a.begin(), a.end()); """, 'Add #include for min_element ' '[build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """foo->swap(0,1); foo.swap(0,1); """, '') self.TestIncludeWhatYouUse( """#include void a(const std::multimap &foobar); """, '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); """, '') self.TestIncludeWhatYouUse( """#include #include #include #include "base/basictypes.h" #include "base/port.h" vector hajoa;""", '') self.TestIncludeWhatYouUse( """#include int i = numeric_limits::max() """, 'Add #include for numeric_limits<>' ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include 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"'] message = self.PerformIncludeWhatYouUse( '#include "blah/a.h"', filename='blah/a.cc', io=MockIo(mock_header_contents)) self.assertEquals(message, '') mock_header_contents = ['#include '] message = self.PerformIncludeWhatYouUse( """#include "blah/a.h" std::set foo;""", filename='blah/a.cc', io=MockIo(mock_header_contents)) self.assertEquals(message, '') # Make sure we can find the correct header file if the cc file seems to be # a temporary file generated by Emacs's flymake. mock_header_contents = [''] message = self.PerformIncludeWhatYouUse( """#include "blah/a.h" std::set foo;""", filename='blah/a_flymake.cc', io=MockIo(mock_header_contents)) self.assertEquals(message, 'Add #include for set<> ' '[build/include_what_you_use] [4]') # If there's just a cc and the header can't be found then it's ok. message = self.PerformIncludeWhatYouUse( """#include "blah/a.h" std::set foo;""", filename='blah/a.cc') self.assertEquals(message, '') # Make sure we find the headers with relative paths. mock_header_contents = [''] message = self.PerformIncludeWhatYouUse( """#include "%s/a.h" std::set foo;""" % os.path.basename(os.getcwd()), filename='a.cc', io=MockIo(mock_header_contents)) self.assertEquals(message, 'Add #include for set<> ' '[build/include_what_you_use] [4]') 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, ''), f('base/internal/google_unittest.cc', 'base/public/google.h')) self.assertEquals((True, 'xxx/yyy/'), f('xxx/yyy/base/internal/google_unittest.cc', 'base/public/google.h')) self.assertEquals((True, 'xxx/yyy/'), f('xxx/yyy/base/google_unittest.cc', 'base/public/google.h')) self.assertEquals((True, ''), f('base/google_unittest.cc', 'base/google-inl.h')) self.assertEquals((True, '/home/build/google3/'), f('/home/build/google3/base/google.cc', 'base/google.h')) self.assertEquals((False, ''), f('/home/build/google3/base/google.cc', 'basu/google.h')) self.assertEquals((False, ''), f('a.cc', 'b.h')) def testCleanseLine(self): self.assertEquals('int foo = 0;', cpplint.CleanseComments('int foo = 0; // danger!')) self.assertEquals('int o = 0;', cpplint.CleanseComments('int /* foo */ o = 0;')) self.assertEquals('foo(int a, int b);', cpplint.CleanseComments('foo(int a /* abc */, int b);')) self.assertEqual('f(a, b);', cpplint.CleanseComments('f(a, /* name */ b);')) self.assertEqual('f(a, b);', cpplint.CleanseComments('f(a /* name */, b);')) self.assertEqual('f(a, b);', cpplint.CleanseComments('f(a, /* name */b);')) self.assertEqual('f(a, b, c);', cpplint.CleanseComments('f(a, /**/b, /**/c);')) self.assertEqual('f(a, b, c);', 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() { static const char kString[] = R"( #endif <- invalid preprocessor should be ignored */ <- invalid comment should be ignored too )"; }""", '') self.TestMultiLineLint( """ void Func() { string s = R"TrueDelimiter( )" )FalseDelimiter" )TrueDelimiter"; }""", '') self.TestMultiLineLint( """ void Func() { char char kString[] = R"( ";" )"; }""", '') self.TestMultiLineLint( """ static const char kRawString[] = R"( \tstatic const int kLineWithTab = 1; static const int kLineWithTrailingWhiteSpace = 1;\x20 void WeirdNumberOfSpacesAtLineStart() { string x; x += StrCat("Use StrAppend instead"); } void BlankLineAtEndOfBlock() { // TODO incorrectly formatted //Badly formatted comment } )";""", '') self.TestMultiLineLint( """ void Func() { string s = StrCat(R"TrueDelimiter( )" )FalseDelimiter" )TrueDelimiter", R"TrueDelimiter2( )" )FalseDelimiter2" )TrueDelimiter2"); }""", '') self.TestMultiLineLint( """ static SomeStruct kData = { {0, R"(line1 line2 )"} };""", '') def testMultiLineComments(self): # missing explicit is bad self.TestMultiLineLint( r"""int a = 0; /* multi-liner class Foo { Foo(int f); // should cause a lint warning in code } */ """, '') self.TestMultiLineLint( r"""/* int a = 0; multi-liner static const int b = 0;""", 'Could not find end of multi-line comment' ' [readability/multiline_comment] [5]') self.TestMultiLineLint(r""" /* multi-line comment""", 'Could not find end of multi-line comment' ' [readability/multiline_comment] [5]') self.TestMultiLineLint(r""" // /* comment, but not multi-line""", '') self.TestMultiLineLint(r"""/********** */""", '') self.TestMultiLineLint(r"""/** * Doxygen comment */""", '') self.TestMultiLineLint(r"""/*! * Doxygen comment */""", '') def testMultilineStrings(self): multiline_string_error_message = ( 'Multi-line string ("...") found. This lint script doesn\'t ' 'do well with such strings, and may give bogus warnings. ' 'Use C++11 raw strings or concatenation instead.' ' [readability/multiline_string] [5]') for extension in ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']: file_path = 'mydir/foo.' + extension 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): old_verbose_level = cpplint._cpplint_state.verbose_level cpplint._cpplint_state.verbose_level = 0 try: # missing explicit is bad self.TestMultiLineLint( """ class Foo { Foo(int f); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # missing explicit is bad, even with whitespace self.TestMultiLineLint( """ class Foo { Foo (int f); };""", ['Extra space before ( in function call [whitespace/parens] [4]', 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]']) # missing explicit, with distracting comment, is still bad self.TestMultiLineLint( """ class Foo { Foo(int f); // simpler than Foo(blargh, blarg) };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # missing explicit, with qualified classname self.TestMultiLineLint( """ class Qualifier::AnotherOne::Foo { Foo(int f); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # missing explicit for inline constructors is bad as well self.TestMultiLineLint( """ class Foo { inline Foo(int f); };""", '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( """ struct Foo { Foo(int f); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # Templatized classes are caught as well. self.TestMultiLineLint( """ template class Foo { Foo(int f); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # inline case for templatized classes. self.TestMultiLineLint( """ template class Foo { inline Foo(int f); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # constructors with a default argument should still be marked explicit self.TestMultiLineLint( """ class Foo { Foo(int f = 0); };""", 'Constructors callable with one argument should be marked explicit.' ' [runtime/explicit] [5]') # multi-argument constructors with all but one default argument should be # marked explicit self.TestMultiLineLint( """ class Foo { Foo(int f, int g = 0); };""", 'Constructors callable with one argument should be marked explicit.' ' [runtime/explicit] [5]') # multi-argument constructors with all default arguments should be marked # explicit self.TestMultiLineLint( """ class Foo { Foo(int f = 0, int g = 0); };""", 'Constructors callable with one argument should be marked explicit.' ' [runtime/explicit] [5]') # explicit no-argument constructors are bad self.TestMultiLineLint( """ class Foo { explicit Foo(); };""", 'Zero-parameter constructors should not be marked explicit.' ' [runtime/explicit] [5]') # void constructors are considered no-argument self.TestMultiLineLint( """ class Foo { explicit Foo(void); };""", 'Zero-parameter constructors should not be marked explicit.' ' [runtime/explicit] [5]') # No warning for multi-parameter constructors self.TestMultiLineLint( """ class Foo { explicit Foo(int f, int g); };""", '') self.TestMultiLineLint( """ class Foo { explicit Foo(int f, int g = 0); };""", '') # single-argument constructors that take a function that takes multiple # arguments should be explicit self.TestMultiLineLint( """ class Foo { Foo(void (*f)(int f, int g)); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # single-argument constructors that take a single template argument with # multiple parameters should be explicit self.TestMultiLineLint( """ template class Foo { Foo(Bar b); };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') # but copy constructors that take multiple template parameters are OK self.TestMultiLineLint( """ template class Foo { Foo(Foo& f); };""", '') # proper style is okay self.TestMultiLineLint( """ class Foo { explicit Foo(int f); };""", '') # two argument constructor is okay self.TestMultiLineLint( """ class Foo { Foo(int f, int b); };""", '') # two argument constructor, across two lines, is okay self.TestMultiLineLint( """ class Foo { Foo(int f, int b); };""", '') # non-constructor (but similar name), is okay self.TestMultiLineLint( """ class Foo { aFoo(int f); };""", '') # constructor with void argument is okay self.TestMultiLineLint( """ class Foo { Foo(void); };""", '') # single argument method is okay self.TestMultiLineLint( """ class Foo { Bar(int b); };""", '') # comments should be ignored self.TestMultiLineLint( """ class Foo { // Foo(int f); };""", '') # single argument function following class definition is okay # (okay, it's not actually valid, but we don't want a false positive) self.TestMultiLineLint( """ class Foo { Foo(int f, int b); }; Foo(int f);""", '') # single argument function is okay self.TestMultiLineLint( """static Foo(int f);""", '') # single argument copy constructor is okay. self.TestMultiLineLint( """ 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 { Foo(Foo const&); };""", '') self.TestMultiLineLint( """ class Foo { Foo(Foo&); };""", '') # templatized copy constructor is okay. self.TestMultiLineLint( """ template class Foo { Foo(const Foo&); };""", '') # Special case for std::initializer_list self.TestMultiLineLint( """ 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', ['void Func() {', ' __asm__ (', ' "hlt"', ' );', ' asm {', ' movdqa [edx + 32], xmm2', ' }', '}'], error_collector) self.assertEquals( 0, error_collector.ResultList().count( 'Extra space before ( in function call [whitespace/parens] [4]')) self.assertEquals( 0, error_collector.ResultList().count( 'Closing ) should be moved to the previous line ' '[whitespace/parens] [2]')) self.assertEquals( 0, error_collector.ResultList().count( 'Extra space before [ [whitespace/braces] [5]')) finally: cpplint._cpplint_state.verbose_level = old_verbose_level def testSlashStarCommentOnSingleLine(self): self.TestMultiLineLint( """/* static */ Foo(int f);""", '') self.TestMultiLineLint( """/*/ static */ Foo(int f);""", '') self.TestMultiLineLint( """/*/ static Foo(int f);""", 'Could not find end of multi-line comment' ' [readability/multiline_comment] [5]') self.TestMultiLineLint( """ /*/ static Foo(int f);""", 'Could not find end of multi-line comment' ' [readability/multiline_comment] [5]') self.TestMultiLineLint( """ /**/ static Foo(int f);""", '') # Test suspicious usage of "if" like this: # if (a == b) { # DoSomething(); # } if (a == c) { // Should be "else if". # DoSomething(); // This gets called twice if a == b && a == c. # } def testSuspiciousUsageOfIf(self): self.TestLint( ' if (a == b) {', '') self.TestLint( ' } if (a == b) {', 'Did you mean "else if"? If not, start a new line for "if".' ' [readability/braces] [4]') # Test suspicious usage of memset. Specifically, a 0 # as the final argument is almost certainly an error. def testSuspiciousUsageOfMemset(self): # Normal use is okay. self.TestLint( ' memset(buf, 0, sizeof(buf))', '') # A 0 as the final argument is almost certainly an error. self.TestLint( ' memset(buf, sizeof(buf), 0)', 'Did you mean "memset(buf, 0, sizeof(buf))"?' ' [runtime/memset] [4]') self.TestLint( ' memset(buf, xsize * ysize, 0)', 'Did you mean "memset(buf, 0, xsize * ysize)"?' ' [runtime/memset] [4]') # There is legitimate test code that uses this form. # This is okay since the second argument is a literal. self.TestLint( " memset(buf, 'y', 0)", '') self.TestLint( ' memset(buf, 4, 0)', '') self.TestLint( ' memset(buf, -1, 0)', '') self.TestLint( ' memset(buf, 0xF1, 0)', '') self.TestLint( ' memset(buf, 0xcd, 0)', '') def testRedundantVirtual(self): self.TestLint('virtual void F()', '') self.TestLint('virtual void F();', '') self.TestLint('virtual void F() {}', '') message_template = ('"%s" is redundant since function is already ' 'declared as "%s" [readability/inheritance] [4]') for virt_specifier in ['override', 'final']: error_message = message_template % ('virtual', virt_specifier) self.TestLint('virtual int F() %s' % virt_specifier, error_message) self.TestLint('virtual int F() %s;' % virt_specifier, error_message) self.TestLint('virtual int F() %s {' % virt_specifier, error_message) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'virtual void F(int a,', ' int b) ' + virt_specifier + ';', 'virtual void F(int a,', ' int b) LOCKS_EXCLUDED(lock) ' + virt_specifier + ';', 'virtual void F(int a,', ' int b)', ' LOCKS_EXCLUDED(lock) ' + virt_specifier + ';', ''], error_collector) self.assertEquals( [error_message, error_message, error_message], error_collector.Results()) error_message = message_template % ('override', 'final') self.TestLint('int F() override final', error_message) self.TestLint('int F() override final;', error_message) self.TestLint('int F() override final {}', error_message) self.TestLint('int F() final override', error_message) self.TestLint('int F() final override;', error_message) self.TestLint('int F() final override {}', error_message) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'struct A : virtual B {', ' ~A() override;' '};', 'class C', ' : public D,', ' public virtual E {', ' void Func() override;', '}', ''], error_collector) self.assertEquals('', error_collector.Results()) self.TestLint('void Finalize(AnnotationProto *final) override;', '') def testCheckDeprecated(self): self.TestLanguageRulesCheck('foo_test.cc', '#include ', '') self.TestLanguageRulesCheck('foo_unittest.cc', '#include ', '') def testCheckPosixThreading(self): self.TestLint('var = sctime_r()', '') self.TestLint('var = strtok_r()', '') self.TestLint('var = strtok_r(foo, ba, r)', '') self.TestLint('var = brand()', '') self.TestLint('_rand()', '') self.TestLint('.rand()', '') self.TestLint('->rand()', '') self.TestLint('ACMRandom rand(seed)', '') self.TestLint('ISAACRandom rand()', '') self.TestLint('var = rand()', 'Consider using rand_r(...) instead of rand(...)' ' for improved thread safety.' ' [runtime/threadsafe_fn] [2]') self.TestLint('var = strtok(str, delim)', 'Consider using strtok_r(...) ' 'instead of strtok(...)' ' for improved thread safety.' ' [runtime/threadsafe_fn] [2]') def testVlogMisuse(self): self.TestLint('VLOG(1)', '') self.TestLint('VLOG(99)', '') self.TestLint('LOG(ERROR)', '') self.TestLint('LOG(INFO)', '') self.TestLint('LOG(WARNING)', '') self.TestLint('LOG(FATAL)', '') self.TestLint('LOG(DFATAL)', '') self.TestLint('VLOG(SOMETHINGWEIRD)', '') self.TestLint('MYOWNVLOG(ERROR)', '') errmsg = ('VLOG() should be used with numeric verbosity level. ' 'Use LOG() if you want symbolic severity levels.' ' [runtime/vlog] [5]') self.TestLint('VLOG(ERROR)', errmsg) self.TestLint('VLOG(INFO)', errmsg) self.TestLint('VLOG(WARNING)', errmsg) self.TestLint('VLOG(FATAL)', errmsg) self.TestLint('VLOG(DFATAL)', errmsg) self.TestLint(' VLOG(ERROR)', errmsg) self.TestLint(' VLOG(INFO)', errmsg) self.TestLint(' VLOG(WARNING)', errmsg) self.TestLint(' VLOG(FATAL)', errmsg) self.TestLint(' VLOG(DFATAL)', errmsg) # Test potential format string bugs like printf(foo). def testFormatStrings(self): self.TestLint('printf("foo")', '') self.TestLint('printf("foo: %s", foo)', '') self.TestLint('DocidForPrintf(docid)', '') # Should not trigger. self.TestLint('printf(format, value)', '') # Should not trigger. self.TestLint('printf(__VA_ARGS__)', '') # Should not trigger. self.TestLint('printf(format.c_str(), value)', '') # Should not trigger. self.TestLint('printf(format(index).c_str(), value)', '') self.TestLint( 'printf(foo)', 'Potential format string bug. Do printf("%s", foo) instead.' ' [runtime/printf] [4]') self.TestLint( 'printf(foo.c_str())', 'Potential format string bug. ' 'Do printf("%s", foo.c_str()) instead.' ' [runtime/printf] [4]') self.TestLint( 'printf(foo->c_str())', 'Potential format string bug. ' 'Do printf("%s", foo->c_str()) instead.' ' [runtime/printf] [4]') self.TestLint( 'StringPrintf(foo)', 'Potential format string bug. Do StringPrintf("%s", foo) instead.' '' ' [runtime/printf] [4]') # Test disallowed use of operator& and other operators. def testIllegalOperatorOverloading(self): errmsg = ('Unary operator& is dangerous. Do not use it.' ' [runtime/operator] [4]') self.TestLint('void operator=(const Myclass&)', '') self.TestLint('void operator&(int a, int b)', '') # binary operator& ok self.TestLint('void operator&() { }', errmsg) self.TestLint('void operator & ( ) { }', ['Extra space after ( [whitespace/parens] [2]', errmsg]) # const string reference members are dangerous.. def testConstStringReferenceMembers(self): errmsg = ('const string& members are dangerous. It is much better to use ' 'alternatives, such as pointers or simple constants.' ' [runtime/member_string_references] [2]') members_declarations = ['const string& church', 'const string &turing', 'const string & godel'] # TODO(unknown): Enable also these tests if and when we ever # decide to check for arbitrary member references. # "const Turing & a", # "const Church& a", # "const vector& a", # "const Kurt::Godel & godel", # "const Kazimierz::Kuratowski& kk" ] # The Good. self.TestLint('void f(const string&)', '') self.TestLint('const string& f(const string& a, const string& b)', '') self.TestLint('typedef const string& A;', '') for decl in members_declarations: self.TestLint(decl + ' = b;', '') self.TestLint(decl + ' =', '') # The Bad. for decl in members_declarations: self.TestLint(decl + ';', errmsg) # Variable-length arrays are not permitted. def testVariableLengthArrayDetection(self): errmsg = ('Do not use variable-length arrays. Use an appropriately named ' "('k' followed by CamelCase) compile-time constant for the size." ' [runtime/arrays] [1]') self.TestLint('int a[any_old_variable];', errmsg) self.TestLint('int doublesize[some_var * 2];', errmsg) self.TestLint('int a[afunction()];', errmsg) self.TestLint('int a[function(kMaxFooBars)];', errmsg) self.TestLint('bool a_list[items_->size()];', errmsg) self.TestLint('namespace::Type buffer[len+1];', errmsg) self.TestLint('int a[64];', '') self.TestLint('int a[0xFF];', '') self.TestLint('int first[256], second[256];', '') self.TestLint('int array_name[kCompileTimeConstant];', '') self.TestLint('char buf[somenamespace::kBufSize];', '') self.TestLint('int array_name[ALL_CAPS];', '') self.TestLint('AClass array1[foo::bar::ALL_CAPS];', '') self.TestLint('int a[kMaxStrLen + 1];', '') self.TestLint('int a[sizeof(foo)];', '') self.TestLint('int a[sizeof(*foo)];', '') self.TestLint('int a[sizeof foo];', '') self.TestLint('int a[sizeof(struct Foo)];', '') self.TestLint('int a[128 - sizeof(const bar)];', '') self.TestLint('int a[(sizeof(foo) * 4)];', '') self.TestLint('int a[(arraysize(fixed_size_array)/2) << 1];', '') self.TestLint('delete a[some_var];', '') self.TestLint('return a[some_var];', '') # DISALLOW_COPY_AND_ASSIGN and DISALLOW_IMPLICIT_CONSTRUCTORS should be at # end of class if present. def testDisallowMacrosAtEnd(self): for macro_name in ( 'DISALLOW_COPY_AND_ASSIGN', 'DISALLOW_IMPLICIT_CONSTRUCTORS'): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'class SomeClass {', ' private:', ' %s(SomeClass);' % macro_name, ' int member_;', '};', ''], error_collector) self.assertEquals( ('%s should be the last thing in the class' % macro_name) + ' [readability/constructors] [3]', error_collector.Results()) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'class OuterClass {', ' private:', ' struct InnerClass {', ' private:', ' %s(InnerClass);' % macro_name, ' int member;', ' };', '};', ''], error_collector) self.assertEquals( ('%s should be the last thing in the class' % macro_name) + ' [readability/constructors] [3]', error_collector.Results()) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'class OuterClass1 {', ' private:', ' struct InnerClass1 {', ' private:', ' %s(InnerClass1);' % macro_name, ' };', ' %s(OuterClass1);' % macro_name, '};', 'struct OuterClass2 {', ' private:', ' class InnerClass2 {', ' private:', ' %s(InnerClass2);' % macro_name, ' // comment', ' };', '', ' %s(OuterClass2);' % macro_name, '', ' // comment', '};', 'void Func() {', ' struct LocalClass {', ' private:', ' %s(LocalClass);' % macro_name, ' } variable;', '}', ''], error_collector) self.assertEquals('', error_collector.Results()) # Brace usage def testBraces(self): # Braces shouldn't be followed by a ; unless they're defining a struct # or initializing an array self.TestLint('int a[3] = { 1, 2, 3 };', '') self.TestLint( """const int foo[] = {1, 2, 3 };""", '') # For single line, unmatched '}' with a ';' is ignored (not enough context) self.TestMultiLineLint( """int a[3] = { 1, 2, 3 };""", '') self.TestMultiLineLint( """int a[2][3] = { { 1, 2 }, { 3, 4 } };""", '') self.TestMultiLineLint( """int a[2][3] = { { 1, 2 }, { 3, 4 } };""", '') # CHECK/EXPECT_TRUE/EXPECT_FALSE replacements def testCheckCheck(self): self.TestLint('CHECK(x == 42);', 'Consider using CHECK_EQ instead of CHECK(a == b)' ' [readability/check] [2]') self.TestLint('CHECK(x != 42);', 'Consider using CHECK_NE instead of CHECK(a != b)' ' [readability/check] [2]') self.TestLint('CHECK(x >= 42);', 'Consider using CHECK_GE instead of CHECK(a >= b)' ' [readability/check] [2]') self.TestLint('CHECK(x > 42);', 'Consider using CHECK_GT instead of CHECK(a > b)' ' [readability/check] [2]') self.TestLint('CHECK(x <= 42);', 'Consider using CHECK_LE instead of CHECK(a <= b)' ' [readability/check] [2]') self.TestLint('CHECK(x < 42);', 'Consider using CHECK_LT instead of CHECK(a < b)' ' [readability/check] [2]') self.TestLint('DCHECK(x == 42);', 'Consider using DCHECK_EQ instead of DCHECK(a == b)' ' [readability/check] [2]') self.TestLint('DCHECK(x != 42);', 'Consider using DCHECK_NE instead of DCHECK(a != b)' ' [readability/check] [2]') self.TestLint('DCHECK(x >= 42);', 'Consider using DCHECK_GE instead of DCHECK(a >= b)' ' [readability/check] [2]') self.TestLint('DCHECK(x > 42);', 'Consider using DCHECK_GT instead of DCHECK(a > b)' ' [readability/check] [2]') self.TestLint('DCHECK(x <= 42);', 'Consider using DCHECK_LE instead of DCHECK(a <= b)' ' [readability/check] [2]') self.TestLint('DCHECK(x < 42);', 'Consider using DCHECK_LT instead of DCHECK(a < b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_TRUE("42" == x);', 'Consider using EXPECT_EQ instead of EXPECT_TRUE(a == b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_TRUE("42" != x);', 'Consider using EXPECT_NE instead of EXPECT_TRUE(a != b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_TRUE(+42 >= x);', 'Consider using EXPECT_GE instead of EXPECT_TRUE(a >= b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_FALSE(x == 42);', 'Consider using EXPECT_NE instead of EXPECT_FALSE(a == b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_FALSE(x != 42);', 'Consider using EXPECT_EQ instead of EXPECT_FALSE(a != b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_FALSE(x >= 42);', 'Consider using EXPECT_LT instead of EXPECT_FALSE(a >= b)' ' [readability/check] [2]') self.TestLint( 'ASSERT_FALSE(x > 42);', 'Consider using ASSERT_LE instead of ASSERT_FALSE(a > b)' ' [readability/check] [2]') self.TestLint( 'ASSERT_FALSE(x <= 42);', 'Consider using ASSERT_GT instead of ASSERT_FALSE(a <= b)' ' [readability/check] [2]') self.TestLint('CHECK(x<42);', ['Missing spaces around <' ' [whitespace/operators] [3]', 'Consider using CHECK_LT instead of CHECK(a < b)' ' [readability/check] [2]']) self.TestLint('CHECK(x>42);', ['Missing spaces around >' ' [whitespace/operators] [3]', 'Consider using CHECK_GT instead of CHECK(a > b)' ' [readability/check] [2]']) self.TestLint('using some::namespace::operator<<;', '') self.TestLint('using some::namespace::operator>>;', '') self.TestLint('CHECK(x->y == 42);', 'Consider using CHECK_EQ instead of CHECK(a == b)' ' [readability/check] [2]') self.TestLint( ' EXPECT_TRUE(42 < x); // Random comment.', 'Consider using EXPECT_LT instead of EXPECT_TRUE(a < b)' ' [readability/check] [2]') self.TestLint( 'EXPECT_TRUE( 42 < x );', ['Extra space after ( in function call' ' [whitespace/parens] [4]', 'Extra space before ) [whitespace/parens] [2]', 'Consider using EXPECT_LT instead of EXPECT_TRUE(a < b)' ' [readability/check] [2]']) self.TestLint('CHECK(4\'2 == x);', 'Consider using CHECK_EQ instead of CHECK(a == b)' ' [readability/check] [2]') def testCheckCheckFalsePositives(self): self.TestLint('CHECK(some_iterator == obj.end());', '') self.TestLint('EXPECT_TRUE(some_iterator == obj.end());', '') self.TestLint('EXPECT_FALSE(some_iterator == obj.end());', '') self.TestLint('CHECK(some_pointer != NULL);', '') self.TestLint('EXPECT_TRUE(some_pointer != NULL);', '') self.TestLint('EXPECT_FALSE(some_pointer != NULL);', '') self.TestLint('CHECK(CreateTestFile(dir, (1 << 20)));', '') self.TestLint('CHECK(CreateTestFile(dir, (1 >> 20)));', '') self.TestLint('CHECK(x ^ (y < 42));', '') self.TestLint('CHECK((x > 42) ^ (x < 54));', '') self.TestLint('CHECK(a && b < 42);', '') self.TestLint('CHECK(42 < a && a < b);', '') self.TestLint('SOFT_CHECK(x > 42);', '') self.TestMultiLineLint( """_STLP_DEFINE_BINARY_OP_CHECK(==, _OP_EQUAL); _STLP_DEFINE_BINARY_OP_CHECK(!=, _OP_NOT_EQUAL); _STLP_DEFINE_BINARY_OP_CHECK(<, _OP_LESS_THAN); _STLP_DEFINE_BINARY_OP_CHECK(<=, _OP_LESS_EQUAL); _STLP_DEFINE_BINARY_OP_CHECK(>, _OP_GREATER_THAN); _STLP_DEFINE_BINARY_OP_CHECK(>=, _OP_GREATER_EQUAL); _STLP_DEFINE_BINARY_OP_CHECK(+, _OP_PLUS); _STLP_DEFINE_BINARY_OP_CHECK(*, _OP_TIMES); _STLP_DEFINE_BINARY_OP_CHECK(/, _OP_DIVIDE); _STLP_DEFINE_BINARY_OP_CHECK(-, _OP_SUBTRACT); _STLP_DEFINE_BINARY_OP_CHECK(%, _OP_MOD);""", '') self.TestLint('CHECK(x < 42) << "Custom error message";', '') # Alternative token to punctuation operator replacements def testCheckAltTokens(self): self.TestLint('true or true', 'Use operator || instead of or' ' [readability/alt_tokens] [2]') self.TestLint('true and true', 'Use operator && instead of and' ' [readability/alt_tokens] [2]') self.TestLint('if (not true)', 'Use operator ! instead of not' ' [readability/alt_tokens] [2]') self.TestLint('1 bitor 1', 'Use operator | instead of bitor' ' [readability/alt_tokens] [2]') self.TestLint('1 xor 1', 'Use operator ^ instead of xor' ' [readability/alt_tokens] [2]') self.TestLint('1 bitand 1', 'Use operator & instead of bitand' ' [readability/alt_tokens] [2]') self.TestLint('x = compl 1', 'Use operator ~ instead of compl' ' [readability/alt_tokens] [2]') self.TestLint('x and_eq y', 'Use operator &= instead of and_eq' ' [readability/alt_tokens] [2]') self.TestLint('x or_eq y', 'Use operator |= instead of or_eq' ' [readability/alt_tokens] [2]') self.TestLint('x xor_eq y', 'Use operator ^= instead of xor_eq' ' [readability/alt_tokens] [2]') self.TestLint('x not_eq y', 'Use operator != instead of not_eq' ' [readability/alt_tokens] [2]') self.TestLint('line_continuation or', 'Use operator || instead of or' ' [readability/alt_tokens] [2]') self.TestLint('if(true and(parentheses', 'Use operator && instead of and' ' [readability/alt_tokens] [2]') self.TestLint('#include "base/false-and-false.h"', '') self.TestLint('#error false or false', '') self.TestLint('false nor false', '') self.TestLint('false nand false', '') # Passing and returning non-const references def testNonConstReference(self): # Passing a non-const reference as function parameter is forbidden. operand_error_message = ('Is this a non-const reference? ' 'If so, make const or use a pointer: %s' ' [runtime/references] [2]') # Warn of use of a non-const reference in operators and functions self.TestLint('bool operator>(Foo& s, Foo& f);', [operand_error_message % 'Foo& s', operand_error_message % 'Foo& f']) self.TestLint('bool operator+(Foo& s, Foo& f);', [operand_error_message % 'Foo& s', operand_error_message % 'Foo& f']) self.TestLint('int len(Foo& s);', operand_error_message % 'Foo& s') # Allow use of non-const references in a few specific cases 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. self.TestLint('void foo(const struct tm& tm);', '') # Passing a const reference to a typename is OK. self.TestLint('void foo(const typename tm& tm);', '') # Const reference to a pointer type is OK. self.TestLint('void foo(const Bar* const& p) {', '') self.TestLint('void foo(Bar const* const& p) {', '') self.TestLint('void foo(Bar* const& p) {', '') # Const reference to a templated type is OK. self.TestLint('void foo(const std::vector& v);', '') # Non-const reference to a pointer type is not OK. self.TestLint('void foo(Bar*& p);', operand_error_message % 'Bar*& p') self.TestLint('void foo(const Bar*& p);', operand_error_message % 'const Bar*& p') self.TestLint('void foo(Bar const*& p);', operand_error_message % 'Bar const*& p') self.TestLint('void foo(struct Bar*& p);', operand_error_message % 'struct Bar*& p') self.TestLint('void foo(const struct Bar*& p);', operand_error_message % 'const struct Bar*& p') self.TestLint('void foo(struct Bar const*& p);', operand_error_message % 'struct Bar const*& p') # Non-const reference to a templated type is not OK. self.TestLint('void foo(std::vector& p);', operand_error_message % 'std::vector& p') # Returning an address of something is not prohibited. self.TestLint('return &something;', '') self.TestLint('if (condition) {return &something; }', '') self.TestLint('if (condition) return &something;', '') self.TestLint('if (condition) address = &something;', '') self.TestLint('if (condition) result = lhs&rhs;', '') self.TestLint('if (condition) result = lhs & rhs;', '') self.TestLint('a = (b+c) * sizeof &f;', '') self.TestLint('a = MySize(b) * sizeof &f;', '') # We don't get confused by C++11 range-based for loops. self.TestLint('for (const string& s : c)', '') self.TestLint('for (auto& r : c)', '') self.TestLint('for (typename Type& a : b)', '') # We don't get confused by some other uses of '&'. self.TestLint('T& operator=(const T& t);', '') self.TestLint('int g() { return (a & b); }', '') self.TestLint('T& r = (T&)*(vp());', '') self.TestLint('T& r = v', '') self.TestLint('static_assert((kBits & kMask) == 0, "text");', '') self.TestLint('COMPILE_ASSERT((kBits & kMask) == 0, text);', '') # Spaces before template arguments. This is poor style, but # happens 0.15% of the time. self.TestLint('void Func(const vector &const_x, ' 'vector &nonconst_x) {', operand_error_message % 'vector &nonconst_x') # Derived member functions are spared from override check self.TestLint('void Func(X& x);', operand_error_message % 'X& x') self.TestLint('void Func(X& x) {}', operand_error_message % 'X& x') self.TestLint('void Func(X& x) override;', '') self.TestLint('void Func(X& x) override {', '') self.TestLint('void Func(X& x) const override;', '') self.TestLint('void Func(X& x) const override {', '') # Don't warn on out-of-line method definitions. self.TestLint('void NS::Func(X& x) {', '') error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company. All Rights Reserved.', 'void a::b() {}', 'void f(int& q) {}', ''], error_collector) self.assertEquals( operand_error_message % 'int& q', error_collector.Results()) # Other potential false positives. These need full parser # state to reproduce as opposed to just TestLint. error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company. All Rights Reserved.', 'void swap(int &x,', ' int &y) {', '}', 'void swap(', ' sparsegroup &x,', ' sparsegroup &y) {', '}', 'ostream& operator<<(', ' ostream& out', ' const dense_hash_set& seq) {', '}', 'class A {', ' void Function(', ' string &x) override {', ' }', '};', 'void Derived::Function(', ' string &x) {', '}', '#define UNSUPPORTED_MASK(_mask) \\', ' if (flags & _mask) { \\', ' LOG(FATAL) << "Unsupported flag: " << #_mask; \\', ' }', 'Constructor::Constructor()', ' : initializer1_(a1 & b1),', ' initializer2_(a2 & b2) {', '}', 'Constructor::Constructor()', ' : initializer1_{a3 & b3},', ' initializer2_(a4 & b4) {', '}', 'Constructor::Constructor()', ' : initializer1_{a5 & b5},', ' initializer2_(a6 & b6) {}', ''], error_collector) self.assertEquals('', error_collector.Results()) # Multi-line references error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company. All Rights Reserved.', 'void Func(const Outer::', ' Inner& const_x,', ' const Outer', ' ::Inner& const_y,', ' const Outer<', ' int>::Inner& const_z,', ' Outer::', ' Inner& nonconst_x,', ' Outer', ' ::Inner& nonconst_y,', ' Outer<', ' int>::Inner& nonconst_z) {', '}', ''], error_collector) self.assertEquals( [operand_error_message % 'Outer::Inner& nonconst_x', operand_error_message % 'Outer::Inner& nonconst_y', operand_error_message % 'Outer::Inner& nonconst_z'], error_collector.Results()) # A peculiar false positive due to bad template argument parsing error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company. All Rights Reserved.', 'inline RCULocked::ReadPtr::ReadPtr(const RCULocked* rcu) {', ' DCHECK(!(data & kFlagMask)) << "Error";', '}', '', 'RCULocked::WritePtr::WritePtr(RCULocked* rcu)', ' : lock_(&rcu_->mutex_) {', '}', ''], error_collector.Results()) self.assertEquals('', error_collector.Results()) def testBraceAtBeginOfLine(self): self.TestLint('{', '{ should almost always be at the end of the previous line' ' [whitespace/braces] [4]') error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['int function()', '{', # warning here ' MutexLock l(&mu);', '}', 'int variable;' '{', # no warning ' MutexLock l(&mu);', '}', 'MyType m = {', ' {value1, value2},', ' {', # no warning ' loooong_value1, looooong_value2', ' }', '};', '#if PREPROCESSOR', '{', # no warning ' MutexLock l(&mu);', '}', '#endif'], error_collector) self.assertEquals(1, error_collector.Results().count( '{ should almost always be at the end of the previous line' ' [whitespace/braces] [4]')) self.TestMultiLineLint( """ foo( { loooooooooooooooong_value, });""", '') def testMismatchingSpacesInParens(self): self.TestLint('if (foo ) {', 'Mismatching spaces inside () in if' ' [whitespace/parens] [5]') self.TestLint('switch ( foo) {', 'Mismatching spaces inside () in switch' ' [whitespace/parens] [5]') self.TestLint('for (foo; ba; bar ) {', 'Mismatching spaces inside () in for' ' [whitespace/parens] [5]') self.TestLint('for (; foo; bar) {', '') self.TestLint('for ( ; foo; bar) {', '') self.TestLint('for ( ; foo; bar ) {', '') self.TestLint('for (foo; bar; ) {', '') self.TestLint('while ( foo ) {', 'Should have zero or one spaces inside' ' ( and ) in while [whitespace/parens] [5]') def testSpacingForFncall(self): self.TestLint('if (foo) {', '') self.TestLint('for (foo; bar; baz) {', '') self.TestLint('for (;;) {', '') # Space should be allowed in placement new operators. self.TestLint('Something* p = new (place) Something();', '') # Test that there is no warning when increment statement is empty. self.TestLint('for (foo; baz;) {', '') self.TestLint('for (foo;bar;baz) {', 'Missing space after ;' ' [whitespace/semicolon] [3]') # we don't warn about this semicolon, at least for now self.TestLint('if (condition) {return &something; }', '') # seen in some macros self.TestLint('DoSth();\\', '') # Test that there is no warning about semicolon here. self.TestLint('abc;// this is abc', 'At least two spaces is best between code' ' and comments [whitespace/comments] [2]') self.TestLint('while (foo) {', '') self.TestLint('switch (foo) {', '') self.TestLint('foo( bar)', 'Extra space after ( in function call' ' [whitespace/parens] [4]') self.TestLint('foo( // comment', '') self.TestLint('foo( // comment', 'At least two spaces is best between code' ' and comments [whitespace/comments] [2]') self.TestLint('foobar( \\', '') self.TestLint('foobar( \\', '') self.TestLint('( a + b)', 'Extra space after (' ' [whitespace/parens] [2]') 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)', '') self.TestLint('typedef foo (*foo12bar_)(foo)', '') self.TestLint('typedef foo (Foo::*bar)(foo)', '') self.TestLint('using foo = type (Foo::*bar)(foo)', '') self.TestLint('using foo = type (Foo::*bar)(', '') self.TestLint('using foo = type (Foo::*)(', '') self.TestLint('foo (Foo::*bar)(', '') self.TestLint('foo (x::y::*z)(', '') self.TestLint('foo (Foo::bar)(', 'Extra space before ( in function call' ' [whitespace/parens] [4]') self.TestLint('foo (*bar)(', '') self.TestLint('typedef foo (Foo::*bar)(', '') self.TestLint('(foo)(bar)', '') self.TestLint('Foo (*foo)(bar)', '') self.TestLint('Foo (*foo)(Bar bar,', '') self.TestLint('char (*p)[sizeof(foo)] = &foo', '') self.TestLint('char (&ref)[sizeof(foo)] = &foo', '') self.TestLint('const char32 (*table[])[6];', '') # The sizeof operator is often written as if it were a function call, with # an opening parenthesis directly following the operator name, but it can # also be written like any other operator, with a space following the # operator name, and the argument optionally in parentheses. self.TestLint('sizeof(foo)', '') self.TestLint('sizeof foo', '') self.TestLint('sizeof (foo)', '') def testSpacingBeforeBraces(self): self.TestLint('if (foo){', 'Missing space before {' ' [whitespace/braces] [5]') self.TestLint('for{', 'Missing space before {' ' [whitespace/braces] [5]') 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) { 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]') self.TestLint('void Func() const {};', 'You don\'t need a ; after a } [readability/braces] [4]') self.TestLint('class X {};', '') for keyword in ['struct', 'union']: for align in ['', ' alignas(16)']: for typename in ['', ' X']: for identifier in ['', ' x']: self.TestLint(keyword + align + typename + ' {}' + identifier + ';', '') 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) {};', 'You don\'t need a ; after a } [readability/braces] [4]') self.TestLint('file_tocs_[i] = (FileToc) {a, b, c};', '') self.TestMultiLineLint('class X : public Y,\npublic Z {};', '') def testSpacingBeforeBrackets(self): self.TestLint('int numbers [] = { 1, 2, 3 };', 'Extra space before [ [whitespace/braces] [5]') # space allowed in some cases self.TestLint('auto [abc, def] = func();', '') self.TestLint('#define NODISCARD [[nodiscard]]', '') self.TestLint('void foo(int param [[maybe_unused]]);', '') def testLambda(self): self.TestLint('auto x = []() {};', '') self.TestLint('return []() {};', '') self.TestMultiLineLint('auto x = []() {\n};\n', '') self.TestLint('int operator[](int x) {};', 'You don\'t need a ; after a } [readability/braces] [4]') self.TestMultiLineLint('auto x = [&a,\nb]() {};', '') self.TestMultiLineLint('auto x = [&a,\nb]\n() {};', '') self.TestMultiLineLint('auto x = [&a,\n' ' b](\n' ' int a,\n' ' int b) {\n' ' return a +\n' ' b;\n' '};\n', '') # Avoid false positives with operator[] self.TestLint('table_to_children[&*table].push_back(dependent);', '') def testBraceInitializerList(self): self.TestLint('MyStruct p = {1, 2};', '') self.TestLint('MyStruct p{1, 2};', '') self.TestLint('vector p = {1, 2};', '') self.TestLint('vector p{1, 2};', '') self.TestLint('x = vector{1, 2};', '') self.TestLint('x = (struct in_addr){ 0 };', '') self.TestLint('Func(vector{1, 2})', '') self.TestLint('Func((struct in_addr){ 0 })', '') self.TestLint('Func(vector{1, 2}, 3)', '') self.TestLint('Func((struct in_addr){ 0 }, 3)', '') self.TestLint('LOG(INFO) << char{7};', '') self.TestLint('LOG(INFO) << char{7} << "!";', '') self.TestLint('int p[2] = {1, 2};', '') self.TestLint('return {1, 2};', '') self.TestLint('std::unique_ptr foo{new Foo{}};', '') self.TestLint('auto foo = std::unique_ptr{new Foo{}};', '') self.TestLint('static_assert(Max7String{}.IsValid(), "");', '') self.TestLint('map_of_pairs[{1, 2}] = 3;', '') self.TestLint('ItemView{has_offer() ? new Offer{offer()} : nullptr', '') self.TestLint('template {}> = 0>', '') self.TestMultiLineLint('std::unique_ptr foo{\n' ' new Foo{}\n' '};\n', '') self.TestMultiLineLint('std::unique_ptr foo{\n' ' new Foo{\n' ' new Bar{}\n' ' }\n' '};\n', '') self.TestMultiLineLint('if (true) {\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' ' [whitespace/braces] [5]') self.TestLint('} else{', 'Missing space before {' ' [whitespace/braces] [5]') self.TestLint('} else {', '') self.TestLint('} else if (foo) {', '') def testSpacingWithInitializerLists(self): self.TestLint('int v[1][3] = {{1, 2, 3}};', '') self.TestLint('int v[1][1] = {{0}};', '') def testSpacingForBinaryOps(self): self.TestLint('if (foo||bar) {', 'Missing spaces around ||' ' [whitespace/operators] [3]') self.TestLint('if (foo<=bar) {', 'Missing spaces around <=' ' [whitespace/operators] [3]') self.TestLint('if (foobar) {', 'Missing spaces around >' ' [whitespace/operators] [3]') self.TestLint('if (foobaz) {', 'Missing spaces around <' ' [whitespace/operators] [3]') self.TestLint('if (foobar) {', 'Missing spaces around <' ' [whitespace/operators] [3]') self.TestLint('template', '') self.TestLint('std::unique_ptr>', '') self.TestLint('typedef hash_map', '') self.TestLint('10<<20', '') self.TestLint('10<>b', 'Missing spaces around >> [whitespace/operators] [3]') self.TestLint('10>>b', 'Missing spaces around >> [whitespace/operators] [3]') self.TestLint('LOG(ERROR)<<*foo', 'Missing spaces around << [whitespace/operators] [3]') self.TestLint('LOG(ERROR)<<&foo', 'Missing spaces around << [whitespace/operators] [3]') self.TestLint('StringCoder>::ToString()', '') self.TestLint('map, map>::iterator', '') self.TestLint('func>>()', '') self.TestLint('MACRO1(list>)', '') self.TestLint('MACRO2(list>, 42)', '') self.TestLint('void DoFoo(const set>& arg1);', '') self.TestLint('void SetFoo(set>* arg1);', '') self.TestLint('foo = new set>;', '') self.TestLint('reinterpret_cast>*>(a);', '') self.TestLint('MACRO(<<)', '') self.TestLint('MACRO(<<, arg)', '') self.TestLint('MACRO(<<=)', '') self.TestLint('MACRO(<<=, arg)', '') self.TestLint('using Vector3::operator==;', '') self.TestLint('using Vector3::operator!=;', '') def testSpacingBeforeLastSemicolon(self): self.TestLint('call_function() ;', 'Extra space before last semicolon. If this should be an ' 'empty statement, use {} instead.' ' [whitespace/semicolon] [5]') self.TestLint('while (true) ;', 'Extra space before last semicolon. If this should be an ' 'empty statement, use {} instead.' ' [whitespace/semicolon] [5]') self.TestLint('default:;', 'Semicolon defining empty statement. Use {} instead.' ' [whitespace/semicolon] [5]') self.TestLint(' ;', 'Line contains only semicolon. If this should be an empty ' 'statement, use {} instead.' ' [whitespace/semicolon] [5]') self.TestLint('for (int i = 0; ;', '') def testEmptyBlockBody(self): self.TestLint('while (true);', 'Empty loop bodies should use {} or continue' ' [whitespace/empty_loop_body] [5]') self.TestLint('if (true);', 'Empty conditional bodies should use {}' ' [whitespace/empty_conditional_body] [5]') self.TestLint('while (true)', '') self.TestLint('while (true) continue;', '') self.TestLint('for (;;);', 'Empty loop bodies should use {} or continue' ' [whitespace/empty_loop_body] [5]') 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' ' [whitespace/empty_loop_body] [5]') self.TestMultiLineLint("""do { } while (false);""", '') self.TestMultiLineLint("""#define MACRO \\ do { \\ } while (false);""", '') self.TestMultiLineLint("""do { } while (false); // next line gets a warning 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: self.TestLint('for (int i : numbers) {', '') # Missing space before colon: self.TestLint('for (int i: numbers) {', 'Missing space around colon in range-based for loop' ' [whitespace/forcolon] [2]') # Missing space after colon: self.TestLint('for (int i :numbers) {', 'Missing space around colon in range-based for loop' ' [whitespace/forcolon] [2]') # Missing spaces both before and after the colon. self.TestLint('for (int i:numbers) {', 'Missing space around colon in range-based for loop' ' [whitespace/forcolon] [2]') # The scope operator '::' shouldn't cause warnings... self.TestLint('for (std::size_t i : sizes) {}', '') # ...but it shouldn't suppress them either. self.TestLint('for (std::size_t i: sizes) {}', 'Missing space around colon in range-based for loop' ' [whitespace/forcolon] [2]') # 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;', nonconst_error_msg) self.TestLint('string kFoo = "hello"; // English', nonconst_error_msg) self.TestLint('static string 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;', 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();', '') self.TestLint('string *pointer = Func();', '') self.TestLint('const string* pointer', '') self.TestLint('const string *pointer', '') self.TestLint('const string* pointer = Func();', '') self.TestLint('const string *pointer = Func();', '') self.TestLint('string const* pointer', '') self.TestLint('string const *pointer', '') self.TestLint('string const* pointer = Func();', '') self.TestLint('string const *pointer = Func();', '') self.TestLint('string* const pointer', '') self.TestLint('string *const pointer', '') self.TestLint('string* const pointer = Func();', '') self.TestLint('string *const pointer = Func();', '') self.TestLint('string Foo::bar() {}', '') self.TestLint('string Foo::operator*() {}', '') # Rare case. 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' 'string FunctionTemplateSpecialization(\n' ' int x) { return ""; }', '') self.TestLint('template<>\n' 'string FunctionTemplateSpecialization* >(\n' ' int x) { return ""; }', '') # should not catch methods of template classes. self.TestLint('string Class::Method() const {\n' ' return "";\n' '}\n', '') self.TestLint('string Class::Method(\n' ' int arg) const {\n' ' return "";\n' '}\n', '') # Check multiline cases. error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'string Class', '::MemberFunction1();', 'string Class::', 'MemberFunction2();', 'string Class::', 'NestedClass::MemberFunction3();', 'string TemplateClass::', 'NestedClass::MemberFunction4();', 'const string Class', '::static_member_variable1;', 'const string Class::', 'static_member_variable2;', 'const string Class', '::static_member_variable3 = "initial value";', 'const string Class::', 'static_member_variable4 = "initial value";', 'string Class::', 'static_member_variable5;', ''], error_collector) self.assertEquals(error_collector.Results(), [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);', '') self.TestLint('TellStory(1, 3 );', 'Extra space before )' ' [whitespace/parens] [2]') self.TestLint('TellStory(1 /* wolf */, 3 /* pigs */);', '') self.TestMultiLineLint("""TellStory(1, 3 );""", 'Closing ) should be moved to the previous line' ' [whitespace/parens] [2]') self.TestMultiLineLint("""TellStory(Wolves(1), Pigs(3 ));""", 'Closing ) should be moved to the previous line' ' [whitespace/parens] [2]') self.TestMultiLineLint("""TellStory(1, 3 );""", 'Extra space before )' ' [whitespace/parens] [2]') def testToDoComments(self): start_space = ('Too many spaces before TODO' ' [whitespace/todo] [2]') missing_username = ('Missing username in TODO; it should look like ' '"// TODO(my_username): Stuff."' ' [readability/todo] [2]') end_space = ('TODO(my_username) should be followed by a space' ' [whitespace/todo] [2]') self.TestLint('// TODOfix this', [start_space, missing_username, end_space]) self.TestLint('// TODO(ljenkins)fix this', [start_space, end_space]) self.TestLint('// TODO fix this', [start_space, missing_username]) self.TestLint('// TODO fix this', missing_username) self.TestLint('// TODO: fix this', missing_username) self.TestLint('//TODO(ljenkins): Fix this', 'Should have a space between // and comment' ' [whitespace/comments] [4]') self.TestLint('// TODO(ljenkins):Fix this', end_space) self.TestLint('// TODO(ljenkins):', '') self.TestLint('// TODO(ljenkins): fix this', '') 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', 'At least two spaces is best between code and comments' ' [whitespace/comments] [2]') self.TestLint('}// namespace foo', 'At least two spaces is best between code and comments' ' [whitespace/comments] [2]') self.TestLint('printf("foo"); // Outside quotes.', 'At least two spaces is best between code and comments' ' [whitespace/comments] [2]') self.TestLint('int i = 0; // Having two spaces is fine.', '') self.TestLint('int i = 0; // Having three spaces is OK.', '') self.TestLint('// Top level comment', '') self.TestLint(' // Line starts with two spaces.', '') self.TestMultiLineLint('void foo() {\n' ' { // A scope is opening.\n' ' int a;', '') self.TestMultiLineLint('void foo() {\n' ' { // A scope is opening.\n' '#define A a', 'At least two spaces is best between code and ' 'comments [whitespace/comments] [2]') self.TestMultiLineLint(' foo();\n' ' { // An indented scope is opening.\n' ' int a;', '') self.TestMultiLineLint('vector my_elements = {// first\n' ' 1,', '') self.TestMultiLineLint('vector my_elements = {// my_elements is ..\n' ' 1,', 'At least two spaces is best between code and ' 'comments [whitespace/comments] [2]') self.TestLint('if (foo) { // not a pure scope; comment is too close!', 'At least two spaces is best between code and comments' ' [whitespace/comments] [2]') self.TestLint('printf("// In quotes.")', '') self.TestLint('printf("\\"%s // In quotes.")', '') self.TestLint('printf("%s", "// In quotes.")', '') def testSpaceAfterCommentMarker(self): self.TestLint('//', '') self.TestLint('//x', 'Should have a space between // and comment' ' [whitespace/comments] [4]') self.TestLint('// x', '') self.TestLint('///', '') self.TestLint('/// x', '') self.TestLint('//!', '') self.TestLint('//----', '') self.TestLint('//====', '') self.TestLint('//////', '') self.TestLint('////// x', '') self.TestLint('///< x', '') # After-member Doxygen comment self.TestLint('//!< x', '') # After-member Doxygen comment self.TestLint('////x', 'Should have a space between // and comment' ' [whitespace/comments] [4]') self.TestLint('//}', '') self.TestLint('//}x', 'Should have a space between // and comment' ' [whitespace/comments] [4]') self.TestLint('//!, ', ' class B = piyo, ', ' class C = fuga >', 'class D {', ' public:', '};', '', '', '', '', '}'], error_collector) self.assertEquals(0, error_collector.Results().count( 'Redundant blank line at the end of a code block should be deleted.' ' [whitespace/blank_line] [3]')) def testAllowBlankLineBeforeIfElseChain(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['if (hoge) {', '', # No warning '} else if (piyo) {', '', # No warning '} else if (piyopiyo) {', ' hoge = true;', # No warning '} else {', '', # Warning on this line '}'], error_collector) self.assertEquals(1, error_collector.Results().count( 'Redundant blank line at the end of a code block should be deleted.' ' [whitespace/blank_line] [3]')) def testAllowBlankLineAfterExtern(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['extern "C" {', '', 'EXPORTAPI void APICALL Some_function() {}', '', '}'], error_collector) self.assertEquals(0, error_collector.Results().count( 'Redundant blank line at the start of a code block should be deleted.' ' [whitespace/blank_line] [2]')) self.assertEquals(0, error_collector.Results().count( 'Redundant blank line at the end of a code block should be deleted.' ' [whitespace/blank_line] [3]')) def testBlankLineBeforeSectionKeyword(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['class A {', ' public:', ' protected:', # warning 1 ' private:', # warning 2 ' struct B {', ' public:', ' private:'] + # warning 3 ([''] * 100) + # Make A and B longer than 100 lines [' };', ' struct C {', ' protected:', ' private:', # C is too short for warnings ' };', '};', 'class D', ' : public {', ' public:', # no warning '};', 'class E {\\', ' public:\\'] + (['\\'] * 100) + # Makes E > 100 lines [' int non_empty_line;\\', ' private:\\', # no warning ' int a;\\', '};'], error_collector) self.assertEquals(2, error_collector.Results().count( '"private:" should be preceded by a blank line' ' [whitespace/blank_line] [3]')) self.assertEquals(1, error_collector.Results().count( '"protected:" should be preceded by a blank line' ' [whitespace/blank_line] [3]')) def testNoBlankLineAfterSectionKeyword(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['class A {', ' public:', '', # warning 1 ' private:', '', # warning 2 ' struct B {', ' protected:', '', # warning 3 ' };', '};'], error_collector) self.assertEquals(1, error_collector.Results().count( 'Do not leave a blank line after "public:"' ' [whitespace/blank_line] [3]')) self.assertEquals(1, error_collector.Results().count( 'Do not leave a blank line after "protected:"' ' [whitespace/blank_line] [3]')) self.assertEquals(1, error_collector.Results().count( 'Do not leave a blank line after "private:"' ' [whitespace/blank_line] [3]')) def testAllowBlankLinesInRawStrings(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['// Copyright 2014 Your Company.', 'static const char *kData[] = {R"(', '', ')", R"(', '', ')"};', ''], error_collector) self.assertEquals('', error_collector.Results()) def testElseOnSameLineAsClosingBraces(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['if (hoge) {', '}', 'else if (piyo) {', # Warning on this line '}', ' else {' # Warning on this line '', '}'], error_collector) self.assertEquals(2, error_collector.Results().count( 'An else should appear on the same line as the preceding }' ' [whitespace/newline] [4]')) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['if (hoge) {', '', '}', 'else', # Warning on this line '{', '', '}'], error_collector) self.assertEquals(1, error_collector.Results().count( 'An else should appear on the same line as the preceding }' ' [whitespace/newline] [4]')) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['if (hoge) {', '', '}', 'else_function();'], error_collector) self.assertEquals(0, error_collector.Results().count( 'An else should appear on the same line as the preceding }' ' [whitespace/newline] [4]')) def testMultipleStatementsOnSameLine(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', ['for (int i = 0; i < 1; i++) {}', 'switch (x) {', ' case 0: func(); break; ', '}', 'sum += MathUtil::SafeIntRound(x); x += 0.1;'], error_collector) self.assertEquals(0, error_collector.Results().count( 'More than one command on the same line [whitespace/newline] [0]')) old_verbose_level = cpplint._cpplint_state.verbose_level cpplint._cpplint_state.verbose_level = 0 cpplint.ProcessFileData('foo.cc', 'cc', ['sum += MathUtil::SafeIntRound(x); x += 0.1;'], 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', ['namespace {', '', '}', # No warning (too short) 'namespace expected {', '} // namespace mismatched', # Warning here 'namespace {', '} // namespace mismatched', # Warning here 'namespace outer { namespace nested {'] + ([''] * 10) + ['}', # Warning here '}', # Warning here 'namespace {'] + ([''] * 10) + ['}', # Warning here 'namespace {'] + ([''] * 10) + ['} // namespace some description', # Anon warning 'namespace {'] + ([''] * 10) + ['} // namespace anonymous', # Variant warning 'namespace {'] + ([''] * 10) + ['} // anonymous namespace (utils)', # Variant 'namespace {'] + ([''] * 10) + ['} // anonymous namespace', # No warning 'namespace missing_comment {'] + ([''] * 10) + ['}', # Warning here 'namespace no_warning {'] + ([''] * 10) + ['} // namespace no_warning', 'namespace no_warning {'] + ([''] * 10) + ['}; // end namespace no_warning', '#define MACRO \\', 'namespace c_style { \\'] + (['\\'] * 10) + ['} /* namespace c_style. */ \\', ';'], error_collector) self.assertEquals(1, error_collector.Results().count( 'Namespace should be terminated with "// namespace expected"' ' [readability/namespace] [5]')) self.assertEquals(1, error_collector.Results().count( 'Namespace should be terminated with "// namespace outer"' ' [readability/namespace] [5]')) self.assertEquals(1, error_collector.Results().count( 'Namespace should be terminated with "// namespace nested"' ' [readability/namespace] [5]')) self.assertEquals(3, error_collector.Results().count( 'Anonymous namespace should be terminated with "// namespace"' ' [readability/namespace] [5]')) self.assertEquals(2, error_collector.Results().count( 'Anonymous namespace should be terminated with "// namespace" or' ' "// anonymous namespace"' ' [readability/namespace] [5]')) self.assertEquals(1, error_collector.Results().count( 'Namespace should be terminated with "// namespace missing_comment"' ' [readability/namespace] [5]')) self.assertEquals(0, error_collector.Results().count( 'Namespace should be terminated with "// namespace no_warning"' ' [readability/namespace] [5]')) def testElseClauseNotOnSameLineAsElse(self): self.TestLint(' else DoSomethingElse();', 'Else clause should never be on same line as else ' '(use 2 lines) [whitespace/newline] [4]') self.TestLint(' else ifDoSomethingElse();', 'Else clause should never be on same line as else ' '(use 2 lines) [whitespace/newline] [4]') self.TestLint(' } else if (blah) {', '') self.TestLint(' variable_ends_in_else = true;', '') def testComma(self): self.TestLint('a = f(1,2);', 'Missing space after , [whitespace/comma] [3]') self.TestLint('int tmp=a,a=b,b=tmp;', ['Missing spaces around = [whitespace/operators] [4]', 'Missing space after , [whitespace/comma] [3]']) self.TestLint('f(a, /* name */ b);', '') self.TestLint('f(a, /* name */b);', '') self.TestLint('f(a, /* name */-1);', '') self.TestLint('f(a, /* name */"1");', '') self.TestLint('f(1, /* empty macro arg */, 2)', '') self.TestLint('f(1,, 2)', '') self.TestLint('operator,()', '') self.TestLint('operator,(a,b)', 'Missing space after , [whitespace/comma] [3]') def testEqualsOperatorSpacing(self): self.TestLint('int tmp= a;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int tmp =a;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int tmp=a;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int tmp= 7;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int tmp =7;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int tmp=7;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int* tmp=*p;', 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('int* tmp= *p;', 'Missing spaces around = [whitespace/operators] [4]') self.TestMultiLineLint( TrimExtraIndent(''' lookahead_services_= ::strings::Split(FLAGS_ls, ",", ::strings::SkipEmpty());'''), 'Missing spaces around = [whitespace/operators] [4]') self.TestLint('bool result = a>=42;', 'Missing spaces around >= [whitespace/operators] [3]') self.TestLint('bool result = a<=42;', 'Missing spaces around <= [whitespace/operators] [3]') self.TestLint('bool result = a==42;', 'Missing spaces around == [whitespace/operators] [3]') self.TestLint('auto result = a!=42;', 'Missing spaces around != [whitespace/operators] [3]') self.TestLint('int a = b!=c;', 'Missing spaces around != [whitespace/operators] [3]') self.TestLint('a&=42;', '') self.TestLint('a|=42;', '') self.TestLint('a^=42;', '') self.TestLint('a+=42;', '') self.TestLint('a*=42;', '') self.TestLint('a/=42;', '') self.TestLint('a%=42;', '') self.TestLint('a>>=5;', '') self.TestLint('a<<=5;', '') def testShiftOperatorSpacing(self): self.TestLint('a<>b', 'Missing spaces around >> [whitespace/operators] [3]') self.TestLint('1<<20', '') self.TestLint('1024>>10', '') self.TestLint('Kernel<<<1, 2>>>()', '') def testIndent(self): self.TestLint('static int noindent;', '') self.TestLint(' int two_space_indent;', '') self.TestLint(' int four_space_indent;', '') self.TestLint(' int one_space_indent;', 'Weird number of spaces at line-start. ' 'Are you using a 2-space indent? [whitespace/indent] [3]') self.TestLint(' int three_space_indent;', 'Weird number of spaces at line-start. ' 'Are you using a 2-space indent? [whitespace/indent] [3]') self.TestLint(' char* one_space_indent = "public:";', 'Weird number of spaces at line-start. ' 'Are you using a 2-space indent? [whitespace/indent] [3]') self.TestLint(' public:', '') self.TestLint(' protected:', '') self.TestLint(' private:', '') self.TestLint(' protected: \\', '') self.TestLint(' public: \\', '') self.TestLint(' private: \\', '') # examples using QT signals/slots macro self.TestMultiLineLint( TrimExtraIndent(""" class foo { public slots: void bar(); signals: };"""), '') self.TestMultiLineLint( TrimExtraIndent(""" class foo { public slots: void bar(); };"""), 'public slots: should be indented +1 space inside class foo' ' [whitespace/indent] [3]') self.TestMultiLineLint( TrimExtraIndent(""" class foo { signals: void bar(); };"""), 'signals: should be indented +1 space inside class foo' ' [whitespace/indent] [3]') self.TestMultiLineLint( TrimExtraIndent(''' static const char kRawString[] = R"(" ")";'''), '') self.TestMultiLineLint( TrimExtraIndent(''' KV>'''), '') self.TestMultiLineLint( ' static const char kSingleLineRawString[] = R"(...)";', 'Weird number of spaces at line-start. ' 'Are you using a 2-space indent? [whitespace/indent] [3]') def testSectionIndent(self): self.TestMultiLineLint( """ class A { public: // no warning private: // warning here };""", 'private: should be indented +1 space inside class A' ' [whitespace/indent] [3]') self.TestMultiLineLint( """ class B { public: // no warning template<> struct C { public: // warning here protected: // no warning }; };""", 'public: should be indented +1 space inside struct C' ' [whitespace/indent] [3]') self.TestMultiLineLint( """ struct D { };""", 'Closing brace should be aligned with beginning of struct D' ' [whitespace/indent] [3]') self.TestMultiLineLint( """ template class F { };""", 'Closing brace should be aligned with beginning of class F' ' [whitespace/indent] [3]') self.TestMultiLineLint( """ class G { Q_OBJECT public slots: signals: };""", ['public slots: should be indented +1 space inside class G' ' [whitespace/indent] [3]', 'signals: should be indented +1 space inside class G' ' [whitespace/indent] [3]']) self.TestMultiLineLint( """ class H { /* comments */ class I { public: // no warning private: // warning here }; };""", 'private: should be indented +1 space inside class I' ' [whitespace/indent] [3]') self.TestMultiLineLint( """ class J : public ::K { public: // no warning protected: // warning here };""", 'protected: should be indented +1 space inside class J' ' [whitespace/indent] [3]') self.TestMultiLineLint( """ class L : public M, public ::N { };""", '') self.TestMultiLineLint( """ template static void Func() { }""", '') def testConditionals(self): self.TestMultiLineLint( """ if (foo) goto fail; goto fail;""", 'If/else bodies with multiple statements require braces' ' [readability/braces] [4]') self.TestMultiLineLint( """ if (foo) goto fail; goto fail;""", 'If/else bodies with multiple statements require braces' ' [readability/braces] [4]') self.TestMultiLineLint( """ if (foo) foo; else goto fail; goto fail;""", 'If/else bodies with multiple statements require braces' ' [readability/braces] [4]') self.TestMultiLineLint( """ if (foo) goto fail; 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) if (bar) baz; else qux;""", 'Else clause should be indented at the same level as if. Ambiguous' ' nested if/else chains require braces. [readability/braces] [4]') self.TestMultiLineLint( """ if (foo) if (bar) baz; else qux;""", 'Else clause should be indented at the same level as if. Ambiguous' ' nested if/else chains require braces. [readability/braces] [4]') self.TestMultiLineLint( """ if (foo) { bar; baz; } else qux;""", 'If an else has a brace on one side, it should have it on both' ' [readability/braces] [5]') self.TestMultiLineLint( """ if (foo) bar; else { baz; }""", 'If an else has a brace on one side, it should have it on both' ' [readability/braces] [5]') self.TestMultiLineLint( """ if (foo) bar; else if (baz) { qux; }""", 'If an else has a brace on one side, it should have it on both' ' [readability/braces] [5]') self.TestMultiLineLint( """ if (foo) { bar; } else if (baz) qux;""", 'If an else has a brace on one side, it should have it on both' ' [readability/braces] [5]') self.TestMultiLineLint( """ if (foo) goto fail; bar;""", '') self.TestMultiLineLint( """ if (foo && bar) { baz; qux; }""", '') self.TestMultiLineLint( """ if (foo) goto fail;""", '') self.TestMultiLineLint( """ if (foo) bar; else baz; qux;""", '') self.TestMultiLineLint( """ for (;;) { if (foo) bar; else baz; }""", '') self.TestMultiLineLint( """ if (foo) bar; else if (baz) baz;""", '') self.TestMultiLineLint( """ if (foo) bar; else baz;""", '') self.TestMultiLineLint( """ if (foo) { bar; } else { baz; }""", '') self.TestMultiLineLint( """ if (foo) { bar; } else if (baz) { qux; }""", '') # Note: this is an error for a different reason, but should not trigger the # single-line if error. self.TestMultiLineLint( """ if (foo) { bar; baz; }""", '{ should almost always be at the end of the previous line' ' [whitespace/braces] [4]') self.TestMultiLineLint( """ if (foo) { \\ bar; \\ baz; \\ }""", '') self.TestMultiLineLint( """ void foo() { if (bar) baz; }""", '') self.TestMultiLineLint( """ #if foo bar; #else baz; qux; #endif""", '') self.TestMultiLineLint( """void F() { variable = [] { if (true); }; variable = [] { if (true); }; Call( [] { if (true); }, [] { if (true); }); }""", '') self.TestMultiLineLint( """ #if(A == 0) foo(); #elif(A == 1) bar(); #endif""", '') self.TestMultiLineLint( """ #if (A == 0) foo(); #elif (A == 1) bar(); #endif""", '') def testTab(self): self.TestLint('\tint a;', 'Tab found; better to use spaces [whitespace/tab] [1]') self.TestLint('int a = 5;\t\t// set a to 5', 'Tab found; better to use spaces [whitespace/tab] [1]') def testParseArguments(self): 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 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) self.assertEquals(old_verbose_level, cpplint._cpplint_state.verbose_level) self.assertEquals(['foo.cc'], cpplint.ParseArguments(['--v=1', 'foo.cc'])) self.assertEquals(1, cpplint._cpplint_state.verbose_level) self.assertEquals(['foo.h'], cpplint.ParseArguments(['--v=3', 'foo.h'])) self.assertEquals(3, cpplint._cpplint_state.verbose_level) self.assertEquals(['foo.cpp'], cpplint.ParseArguments(['--verbose=5', 'foo.cpp'])) self.assertEquals(5, cpplint._cpplint_state.verbose_level) self.assertRaises(ValueError, cpplint.ParseArguments, ['--v=f', 'foo.cc']) self.assertEquals(['foo.cc'], cpplint.ParseArguments(['--output=emacs', 'foo.cc'])) self.assertEquals('emacs', cpplint._cpplint_state.output_format) self.assertEquals(['foo.h'], cpplint.ParseArguments(['--output=vs7', 'foo.h'])) self.assertEquals('vs7', cpplint._cpplint_state.output_format) self.assertRaises(SystemExit, cpplint.ParseArguments, ['--output=blah', 'foo.cc']) filt = '-,+whitespace,-whitespace/indent' self.assertEquals(['foo.h'], cpplint.ParseArguments(['--filter='+filt, 'foo.h'])) self.assertEquals(['-', '+whitespace', '-whitespace/indent'], cpplint._cpplint_state.filters) 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.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: 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 = os.path.realpath(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 = os.path.realpath(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 = os.path.realpath(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( '// H %s' % ('H' * 75), '') self.TestLint( '// H %s' % ('H' * 76), 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') cpplint._line_length = 120 self.TestLint( '// H %s' % ('H' * 115), '') self.TestLint( '// H %s' % ('H' * 116), 'Lines should be <= 120 characters long' ' [whitespace/line_length] [2]') finally: cpplint._line_length = old_line_length def testFilter(self): old_filters = cpplint._cpplint_state.filters try: cpplint._cpplint_state.SetFilters('-,+whitespace,-whitespace/indent') self.TestLint( '// Hello there ', 'Line ends in whitespace. Consider deleting these extra spaces.' ' [whitespace/end_of_line] [4]') self.TestLint('int a = (int)1.0;', '') self.TestLint(' weird opening space', '') finally: cpplint._cpplint_state.filters = old_filters def testDefaultFilter(self): default_filters = cpplint._DEFAULT_FILTERS old_filters = cpplint._cpplint_state.filters cpplint._DEFAULT_FILTERS = ['-whitespace'] try: # Reset filters cpplint._cpplint_state.SetFilters('') self.TestLint('// Hello there ', '') cpplint._cpplint_state.SetFilters('+whitespace/end_of_line') self.TestLint( '// Hello there ', 'Line ends in whitespace. Consider deleting these extra spaces.' ' [whitespace/end_of_line] [4]') self.TestLint(' weird opening space', '') finally: cpplint._cpplint_state.filters = old_filters cpplint._DEFAULT_FILTERS = default_filters def testDuplicateHeader(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('path/self.cc', 'cc', ['// Copyright 2014 Your Company. All Rights Reserved.', '#include "path/self.h"', '#include "path/duplicate.h"', '#include "path/duplicate.h"', '#ifdef MACRO', '#include "path/unique.h"', '#else', '#include "path/unique.h"', '#endif', ''], error_collector) self.assertEquals( ['"path/duplicate.h" already included at path/self.cc:3 ' '[build/include] [4]'], error_collector.ResultList()) def testUnnamedNamespacesInHeaders(self): for extension in ['h', 'hpp', 'hxx', 'h++', 'cuh']: self.doTestUnnamedNamespacesInHeaders(extension) def doTestUnnamedNamespacesInHeaders(self, extension): self.TestLanguageRulesCheck( 'foo.' + extension, 'namespace {', 'Do not use unnamed namespaces in header files. See' ' https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' ' for more information. [build/namespaces_headers] [4]') # namespace registration macros are OK. self.TestLanguageRulesCheck('foo.' + extension, 'namespace { \\', '') # named namespaces are OK. 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, # and that it will report when it can't. # Use multi-line linter because it performs the ClassState check. self.TestMultiLineLint( 'class Foo {', 'Failed to find complete declaration of class Foo' ' [build/class] [5]') # Do the same for namespaces self.TestMultiLineLint( 'namespace Foo {', 'Failed to find complete declaration of namespace Foo' ' [build/namespaces] [5]') # Don't warn on forward declarations of various types. self.TestMultiLineLint( 'class Foo;', '') self.TestMultiLineLint( """struct Foo* foo = NewFoo();""", '') # Test preprocessor. self.TestMultiLineLint( """#ifdef DERIVE_FROM_GOO struct Foo : public Goo { #else struct Foo : public Hoo { #endif };""", '') self.TestMultiLineLint( """ class Foo #ifdef DERIVE_FROM_GOO : public Goo { #else : public Hoo { #endif };""", '') # Test incomplete class self.TestMultiLineLint( 'class Foo {', 'Failed to find complete declaration of class Foo' ' [build/class] [5]') def testBuildEndComment(self): # The crosstool compiler we currently use will fail to compile the # code in this test, so we might consider removing the lint check. self.TestMultiLineLint( """#if 0 #endif Not a comment""", 'Uncommented text after #endif is non-standard. Use a comment.' ' [build/endif_comment] [5]') def testBuildForwardDecl(self): # The crosstool compiler we currently use will fail to compile the # code in this test, so we might consider removing the lint check. self.TestLint('class Foo::Goo;', 'Inner-style forward declarations are invalid.' ' Remove this line.' ' [build/forward_decl] [5]') def GetBuildHeaderGuardPreprocessorSymbol(self, file_path): # Figure out the expected header guard by processing an empty file. error_collector = ErrorCollector(self.assert_) 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-Z0-9_]+)', error) if matched is not None: return matched.group(1) def testBuildHeaderGuard(self): file_path = 'mydir/foo.h' expected_guard = self.GetBuildHeaderGuardPreprocessorSymbol(file_path) self.assertTrue(re.search('MYDIR_FOO_H_$', expected_guard)) # No guard at all: expect one error. error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', [], error_collector) self.assertEquals( 1, error_collector.ResultList().count( 'No #ifndef header guard found, suggested CPP variable is: %s' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # No header guard, but the error is suppressed. error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['// Copyright 2014 Your Company.', '// NOLINT(build/header_guard)', ''], error_collector) self.assertEquals([], error_collector.ResultList()) # Wrong guard error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef FOO_H', '#define FOO_H'], 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()) # No define error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s' % expected_guard], error_collector) self.assertEquals( 1, error_collector.ResultList().count( 'No #ifndef header guard found, suggested CPP variable is: %s' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # Mismatched define error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s' % expected_guard, '#define FOO_H'], error_collector) self.assertEquals( 1, error_collector.ResultList().count( 'No #ifndef header guard found, suggested CPP variable is: %s' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # No endif error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s' % expected_guard, '#define %s' % expected_guard, ''], error_collector) self.assertEquals( 1, error_collector.ResultList().count( '#endif line should be "#endif // %s"' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # Commentless endif error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s' % expected_guard, '#define %s' % expected_guard, '#endif'], error_collector) self.assertEquals( 1, error_collector.ResultList().count( '#endif line should be "#endif // %s"' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # Commentless endif for old-style guard error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s_' % expected_guard, '#define %s_' % expected_guard, '#endif'], error_collector) self.assertEquals( 1, error_collector.ResultList().count( '#endif line should be "#endif // %s"' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # No header guard errors error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s' % expected_guard, '#define %s' % expected_guard, '#endif // %s' % expected_guard], error_collector) for line in error_collector.ResultList(): if line.find('build/header_guard') != -1: self.fail('Unexpected error: %s' % line) # No header guard errors for old-style guard error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s_' % expected_guard, '#define %s_' % expected_guard, '#endif // %s_' % expected_guard], error_collector) for line in error_collector.ResultList(): if line.find('build/header_guard') != -1: self.fail('Unexpected error: %s' % line) old_verbose_level = cpplint._cpplint_state.verbose_level try: cpplint._cpplint_state.verbose_level = 0 # Warn on old-style guard if verbosity is 0. error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef %s_' % expected_guard, '#define %s_' % expected_guard, '#endif // %s_' % expected_guard], error_collector) self.assertEquals( 1, error_collector.ResultList().count( '#ifndef header guard has wrong style, please use: %s' ' [build/header_guard] [0]' % expected_guard), error_collector.ResultList()) finally: cpplint._cpplint_state.verbose_level = old_verbose_level # Completely incorrect header guard error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#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()) # incorrect header guard with nolint error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'h', ['#ifndef FOO // NOLINT', '#define FOO', '#endif // FOO NOLINT'], error_collector) self.assertEquals( 0, error_collector.ResultList().count( '#ifndef header guard has wrong style, please use: %s' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) self.assertEquals( 0, error_collector.ResultList().count( '#endif line should be "#endif // %s"' ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) # Special case for flymake for test_file in ['mydir/foo_flymake.h', 'mydir/.flymake/foo.h']: error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(test_file, 'h', ['// Copyright 2014 Your Company.', ''], error_collector) self.assertEquals( 1, error_collector.ResultList().count( 'No #ifndef header guard found, suggested CPP variable is: %s' ' [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): temp_directory = os.path.realpath(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, # FileInfo.RepositoryName returns the same value as FileInfo.FullName. # This can happen when this source file was obtained without .svn or # .git directory. (e.g. using 'svn export' or 'git archive'). # Skip this test in such a case because --root flag makes sense only # when the root directory of the repository is properly deduced. return 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 = os.path.realpath(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)) # Unix directory aliases are not allowed, and should trigger the # "include itse header file" error error_collector = ErrorCollector(self.assertTrue) cpplint.ProcessFileData( 'test/foo.cc', 'cc', [r'#include "./test/foo.h"', '' ], error_collector) expected = "{dir}/{fn}.cc should include its header file {dir}/{fn}.h{unix_text} [build/include] [5]".format( fn="foo", dir=test_directory, unix_text=". Relative paths like . and .. are not allowed.") self.assertEqual( 1, 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 = os.path.realpath(tempfile.mkdtemp()) temp_directory2 = os.path.realpath(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_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( 'foo.cc', 'cc', [r'printf("\%%d", value);', r'snprintf(buffer, sizeof(buffer), "\[%d", value);', r'fprintf(file, "\(%d", value);', r'vsnprintf(buffer, sizeof(buffer), "\\\{%d", ap);'], error_collector) self.assertEquals( 4, error_collector.Results().count( '%, [, (, and { are undefined character escapes. Unescape them.' ' [build/printf_format] [3]')) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( 'foo.cc', 'cc', ['// Copyright 2014 Your Company.', r'printf("\\%%%d", value);', r'printf(R"(\[)");', r'printf(R"(\[%s)", R"(\])");', ''], error_collector) self.assertEquals('', error_collector.Results()) def testRuntimePrintfFormat(self): self.TestLint( r'fprintf(file, "%q", value);', '%q in format strings is deprecated. Use %ll instead.' ' [runtime/printf_format] [3]') self.TestLint( r'aprintf(file, "The number is %12q", value);', '%q in format strings is deprecated. Use %ll instead.' ' [runtime/printf_format] [3]') self.TestLint( r'printf(file, "The number is" "%-12q", value);', '%q in format strings is deprecated. Use %ll instead.' ' [runtime/printf_format] [3]') self.TestLint( r'printf(file, "The number is" "%+12q", value);', '%q in format strings is deprecated. Use %ll instead.' ' [runtime/printf_format] [3]') self.TestLint( r'printf(file, "The number is" "% 12q", value);', '%q in format strings is deprecated. Use %ll instead.' ' [runtime/printf_format] [3]') self.TestLint( r'snprintf(file, "Never mix %d and %1$d parameters!", value);', '%N$ formats are unconventional. Try rewriting to avoid them.' ' [runtime/printf_format] [2]') def TestLintLogCodeOnError(self, code, expected_message): # Special TestLint which logs the input code on error. result = self.PerformSingleLineLint(code) if result != expected_message: self.fail('For code: "%s"\nGot: "%s"\nExpected: "%s"' % (code, result, expected_message)) def testBuildStorageClass(self): qualifiers = [None, 'const', 'volatile'] signs = [None, 'signed', 'unsigned'] types = ['void', 'char', 'int', 'float', 'double', 'schar', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] storage_classes = ['extern', 'register', 'static', 'typedef'] build_storage_class_error_message = ( '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;', build_storage_class_error_message) self.TestLint('char static foo;', build_storage_class_error_message) self.TestLint('double const static foo = 2.0;', build_storage_class_error_message) self.TestLint('uint64 typedef unsigned_long_long;', build_storage_class_error_message) self.TestLint('int register foo = 0;', build_storage_class_error_message) # Since there are a very large number of possibilities, randomly # construct declarations. # Make sure that the declaration is logged if there's an error. # Seed generator with an integer for absolute reproducibility. random.seed(25) for unused_i in range(10): # Build up random list of non-storage-class declaration specs. other_decl_specs = [random.choice(qualifiers), random.choice(signs), random.choice(types)] # remove None other_decl_specs = [x for x in other_decl_specs if x is not None] # shuffle random.shuffle(other_decl_specs) # insert storage class after the first storage_class = random.choice(storage_classes) insertion_point = random.randint(1, len(other_decl_specs)) decl_specs = (other_decl_specs[0:insertion_point] + [storage_class] + other_decl_specs[insertion_point:]) self.TestLintLogCodeOnError( ' '.join(decl_specs) + ';', build_storage_class_error_message) # but no error if storage class is first self.TestLintLogCodeOnError( storage_class + ' ' + ' '.join(other_decl_specs), '') def testLegalCopyright(self): legal_copyright_message = ( 'No copyright message found. ' 'You should have a line: "Copyright [year] "' ' [legal/copyright] [5]') copyright_line = '// Copyright 2014 Google Inc. All Rights Reserved.' file_path = 'mydir/googleclient/foo.cc' # There should be a copyright message in the first 10 lines error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'cc', [], error_collector) self.assertEquals( 1, error_collector.ResultList().count(legal_copyright_message)) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( file_path, 'cc', ['' for unused_i in range(10)] + [copyright_line], error_collector) self.assertEquals( 1, error_collector.ResultList().count(legal_copyright_message)) # Test that warning isn't issued if Copyright line appears early enough. error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(file_path, 'cc', [copyright_line], error_collector) for message in error_collector.ResultList(): if message.find('legal/copyright') != -1: self.fail('Unexpected error: %s' % message) error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( file_path, 'cc', ['' for unused_i in range(9)] + [copyright_line], error_collector) for message in error_collector.ResultList(): if message.find('legal/copyright') != -1: self.fail('Unexpected error: %s' % message) def testInvalidIncrement(self): self.TestLint('*count++;', 'Changing pointer instead of value (or unused value of ' 'operator*). [runtime/invalid_increment] [5]') def testSnprintfSize(self): self.TestLint('vsnprintf(NULL, 0, format)', '') self.TestLint('snprintf(fisk, 1, format)', 'If you can, use sizeof(fisk) instead of 1 as the 2nd arg ' 'to snprintf. [runtime/printf] [3]') class Cxx11Test(CpplintTestBase): def Helper(self, package, extension, lines, count): filename = package + '/foo.' + extension lines = lines[:] # Header files need to have an ifdef guard wrapped around their code. if extension.startswith('h'): guard = filename.upper().replace('/', '_').replace('.', '_') + '_' lines.insert(0, '#ifndef ' + guard) lines.insert(1, '#define ' + guard) lines.append('#endif // ' + guard) # All files need a final blank line. lines.append('') # Process the file and check resulting error count. collector = ErrorCollector(self.assert_) cpplint.ProcessFileData(filename, extension, lines, collector) error_list = collector.ResultList() self.assertEquals(count, len(error_list), error_list) def TestCxx11Feature(self, code, expected_error): lines = code.split('\n') collector = ErrorCollector(self.assert_) cpplint.RemoveMultiLineComments('foo.h', lines, collector) clean_lines = cpplint.CleansedLines(lines) cpplint.FlagCxx11Features('foo.cc', clean_lines, 0, collector) 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]') def testBlockedClasses(self): self.TestCxx11Feature('std::alignment_of', 'std::alignment_of is an unapproved ' 'C++11 class or function. Send c-style an example ' 'of where it would make your code more readable, ' 'and they may let you use it.' ' [build/c++11] [5]') self.TestCxx11Feature('std::alignment_offer', '') self.TestCxx11Feature('mystd::alignment_of', '') self.TestCxx11Feature('std::binomial_distribution', '') def testBlockedFunctions(self): self.TestCxx11Feature('std::alignment_of', 'std::alignment_of is an unapproved ' 'C++11 class or function. Send c-style an example ' 'of where it would make your code more readable, ' 'and they may let you use it.' ' [build/c++11] [5]') # Missed because of the lack of "std::". Compiles because ADL # looks in the namespace of my_shared_ptr, which (presumably) is # std::. But there will be a lint error somewhere in this file # since my_shared_ptr had to be defined. self.TestCxx11Feature('static_pointer_cast(my_shared_ptr)', '') self.TestCxx11Feature('std::declval()', '') def testExplicitMakePair(self): self.TestLint('make_pair', '') self.TestLint('make_pair(42, 42)', '') self.TestLint('make_pair<', 'For C++11-compatibility, omit template arguments from' ' make_pair OR use pair directly OR if appropriate,' ' construct a pair directly' ' [build/explicit_make_pair] [4]') self.TestLint('make_pair <', 'For C++11-compatibility, omit template arguments from' ' make_pair OR use pair directly OR if appropriate,' ' construct a pair directly' ' [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): lines = ['Line 1', 'Line 2', 'Line 3 // Comment test', 'Line 4 /* Comment test */', 'Line 5 "foo"'] clean_lines = cpplint.CleansedLines(lines) self.assertEquals(lines, clean_lines.raw_lines) self.assertEquals(5, clean_lines.NumLines()) self.assertEquals(['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5 "foo"'], clean_lines.lines) self.assertEquals(['Line 1', 'Line 2', 'Line 3', 'Line 4', 'Line 5 ""'], clean_lines.elided) def testInitEmpty(self): clean_lines = cpplint.CleansedLines([]) self.assertEquals([], clean_lines.raw_lines) self.assertEquals(0, clean_lines.NumLines()) def testCollapseStrings(self): collapse = cpplint.CleansedLines._CollapseStrings self.assertEquals('""', collapse('""')) # "" (empty) self.assertEquals('"""', collapse('"""')) # """ (bad) self.assertEquals('""', collapse('"xyz"')) # "xyz" (string) self.assertEquals('""', collapse('"\\\""')) # "\"" (string) self.assertEquals('""', collapse('"\'"')) # "'" (string) self.assertEquals('"\"', collapse('"\"')) # "\" (bad) self.assertEquals('""', collapse('"\\\\"')) # "\\" (string) self.assertEquals('"', collapse('"\\\\\\"')) # "\\\" (bad) self.assertEquals('""', collapse('"\\\\\\\\"')) # "\\\\" (string) self.assertEquals('\'\'', collapse('\'\'')) # '' (empty) self.assertEquals('\'\'', collapse('\'a\'')) # 'a' (char) self.assertEquals('\'\'', collapse('\'\\\'\'')) # '\'' (char) self.assertEquals('\'', collapse('\'\\\'')) # '\' (bad) self.assertEquals('', collapse('\\012')) # '\012' (char) self.assertEquals('', collapse('\\xfF0')) # '\xfF0' (char) self.assertEquals('', collapse('\\n')) # '\n' (char) self.assertEquals(r'\#', collapse('\\#')) # '\#' (bad) self.assertEquals('"" + ""', collapse('"\'" + "\'"')) self.assertEquals("'', ''", collapse("'\"', '\"'")) self.assertEquals('""[0b10]', collapse('"a\'b"[0b1\'0]')) self.assertEquals('42', collapse("4'2")) self.assertEquals('0b0101', collapse("0b0'1'0'1")) self.assertEquals('1048576', collapse("1'048'576")) self.assertEquals('0X100000', collapse("0X10'0000")) self.assertEquals('0004000000', collapse("0'004'000'000")) self.assertEquals('1.602176565e-19', collapse("1.602'176'565e-19")) self.assertEquals('\'\' + 0xffff', collapse("'i' + 0xf'f'f'f")) self.assertEquals('sizeof\'\' == 1', collapse("sizeof'x' == 1")) self.assertEquals('0x.03p100', collapse('0x.0\'3p1\'0\'0')) self.assertEquals('123.45', collapse('1\'23.4\'5')) self.assertEquals('StringReplace(body, "", "");', collapse('StringReplace(body, "\\\\", "\\\\\\\\");')) self.assertEquals('\'\' ""', collapse('\'"\' "foo"')) class OrderOfIncludesTest(CpplintTestBase): def setUp(self): CpplintTestBase.setUp(self) self.include_state = cpplint._IncludeState() os.path.abspath = lambda value: value def testCheckNextIncludeOrder_OtherThenCpp(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._OTHER_HEADER)) self.assertEqual('Found C++ system header after other header', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) def testCheckNextIncludeOrder_CppThenC(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) self.assertEqual('Found C system header after C++ system header', self.include_state.CheckNextIncludeOrder( cpplint._C_SYS_HEADER)) def testCheckNextIncludeOrder_OtherSysThenC(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._OTHER_SYS_HEADER)) self.assertEqual('Found C system header after other system header', self.include_state.CheckNextIncludeOrder( cpplint._C_SYS_HEADER)) def testCheckNextIncludeOrder_OtherSysThenCpp(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._OTHER_SYS_HEADER)) self.assertEqual('Found C++ system header after other system header', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) def testCheckNextIncludeOrder_LikelyThenCpp(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._LIKELY_MY_HEADER)) self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) def testCheckNextIncludeOrder_PossibleThenCpp(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._POSSIBLE_MY_HEADER)) self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) def testCheckNextIncludeOrder_CppThenLikely(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) # This will eventually fail. self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._LIKELY_MY_HEADER)) def testCheckNextIncludeOrder_CppThenPossible(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._POSSIBLE_MY_HEADER)) def testCheckNextIncludeOrder_CppThenOtherSys(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._CPP_SYS_HEADER)) self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._OTHER_SYS_HEADER)) def testCheckNextIncludeOrder_OtherSysThenPossible(self): self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._OTHER_SYS_HEADER)) self.assertEqual('', self.include_state.CheckNextIncludeOrder( cpplint._POSSIBLE_MY_HEADER)) def testClassifyInclude(self): file_info = cpplint.FileInfo classify_include = cpplint._ClassifyInclude self.assertEqual(cpplint._C_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'stdio.h', True)) self.assertEqual(cpplint._C_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'sys/time.h', True)) self.assertEqual(cpplint._C_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'netipx/ipx.h', True)) self.assertEqual(cpplint._C_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'arpa/ftp.h', True)) self.assertEqual(cpplint._CPP_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'string', True)) self.assertEqual(cpplint._CPP_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'typeinfo', True)) self.assertEqual(cpplint._C_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'foo/foo.h', True)) self.assertEqual(cpplint._OTHER_SYS_HEADER, classify_include(file_info('foo/foo.cc'), 'foo/foo.h', True, "standardcfirst")) self.assertEqual(cpplint._OTHER_HEADER, 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'), 'foo/foo-inl.h', False)) self.assertEqual(cpplint._LIKELY_MY_HEADER, classify_include(file_info('foo/internal/foo.cc'), 'foo/public/foo.h', False)) self.assertEqual(cpplint._POSSIBLE_MY_HEADER, classify_include(file_info('foo/internal/foo.cc'), 'foo/other/public/foo.h', False)) self.assertEqual(cpplint._OTHER_HEADER, classify_include(file_info('foo/internal/foo.cc'), 'foo/other/public/foop.h', 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): include_list = [] for item in includes: if item.startswith('"') or item.startswith('<'): include_list.append('#include %s\n' % item) else: include_list.append(item + '\n') return ''.join(include_list) # Test singleton cases first. self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/foo.h"']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/foo-inl.h"']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['"bar/bar-inl.h"']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['"bar/bar.h"']), '') # Test everything in a good and new order. self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/foo.h"', '"foo/foo-inl.h"', '', '', '', '"bar/bar-inl.h"', '"bar/bar.h"']), '') # Test bad orders. self.TestLanguageRulesCheck( 'foo/foo.cc', Format(['', '']), 'Found C system header after C++ system header.' ' Should be: foo.h, c system, c++ system, other.' ' [build/include_order] [4]') self.TestLanguageRulesCheck( 'foo/foo.cc', Format(['"foo/bar-inl.h"', '"foo/foo-inl.h"']), '') self.TestLanguageRulesCheck( 'foo/foo.cc', Format(['"foo/e.h"', '"foo/b.h"', # warning here (e>b) '"foo/c.h"', '"foo/d.h"', '"foo/a.h"']), # warning here (d>a) ['Include "foo/b.h" not in alphabetical order' ' [build/include_alpha] [4]', 'Include "foo/a.h" not in alphabetical order' ' [build/include_alpha] [4]']) # -inl.h headers are no longer special. self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/foo-inl.h"', '']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/bar.h"', '"foo/bar-inl.h"']), '') # Test componentized header. OK to have my header in ../public dir. self.TestLanguageRulesCheck('foo/internal/foo.cc', Format(['"foo/public/foo.h"', '']), '') # OK to have my header in other dir (not stylistically, but # cpplint isn't as good as a human). self.TestLanguageRulesCheck('foo/internal/foo.cc', Format(['"foo/other/public/foo.h"', '']), '') self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/foo.h"', '', '"base/google.h"', '"base/flags.h"']), 'Include "base/flags.h" not in alphabetical ' 'order [build/include_alpha] [4]') # According to the style, -inl.h should come before .h, but we don't # complain about that. self.TestLanguageRulesCheck('foo/foo.cc', Format(['"foo/foo-inl.h"', '"foo/foo.h"', '"base/google.h"', '"base/google-inl.h"']), '') # Allow project includes to be separated by blank lines self.TestLanguageRulesCheck('a/a.cc', Format(['"a/a.h"', '', '"base/google.h"', '', '"b/c.h"', '', 'MACRO', '"a/b.h"']), '') self.TestLanguageRulesCheck('a/a.cc', Format(['"a/a.h"', '', '"base/google.h"', '"a/b.h"']), 'Include "a/b.h" not in alphabetical ' 'order [build/include_alpha] [4]') # Test conditional includes self.TestLanguageRulesCheck( 'a/a.cc', ''.join(['#include \n', '#include "base/port.h"\n', '#include \n']), ('Found C++ system header after other header. ' 'Should be: a.h, c system, c++ system, other. ' '[build/include_order] [4]')) self.TestLanguageRulesCheck( 'a/a.cc', ''.join(['#include \n', '#include "base/port.h"\n', '#ifdef LANG_CXX11\n', '#include \n', '#endif // LANG_CXX11\n']), '') self.TestLanguageRulesCheck( 'a/a.cc', ''.join(['#include \n', '#ifdef LANG_CXX11\n', '#include "base/port.h"\n', '#include \n', '#endif // LANG_CXX11\n']), ('Found C++ system header after other header. ' 'Should be: a.h, c system, c++ system, other. ' '[build/include_order] [4]')) # Third party headers are exempt from order checks self.TestLanguageRulesCheck('foo/foo.cc', Format(['', '"Python.h"', '']), '') class CheckForFunctionLengthsTest(CpplintTestBase): def setUp(self): # Reducing these thresholds for the tests speeds up tests significantly. self.old_normal_trigger = cpplint._FunctionState._NORMAL_TRIGGER self.old_test_trigger = cpplint._FunctionState._TEST_TRIGGER cpplint._FunctionState._NORMAL_TRIGGER = 10 cpplint._FunctionState._TEST_TRIGGER = 25 def tearDown(self): cpplint._FunctionState._NORMAL_TRIGGER = self.old_normal_trigger cpplint._FunctionState._TEST_TRIGGER = self.old_test_trigger def TestFunctionLengthsCheck(self, code, expected_message): """Check warnings for long function bodies are as expected. Args: code: C++ source code expected to generate a warning message. expected_message: Message expected to be generated by the C++ code. """ self.assertEquals(expected_message, self.PerformFunctionLengthsCheck(code)) def TriggerLines(self, error_level): """Return number of lines needed to trigger a function length warning. Args: error_level: --v setting for cpplint. Returns: Number of lines needed to trigger a function length warning. """ return cpplint._FunctionState._NORMAL_TRIGGER * 2**error_level def TestLines(self, error_level): """Return number of lines needed to trigger a test function length warning. Args: error_level: --v setting for cpplint. Returns: Number of lines needed to trigger a test function length warning. """ return cpplint._FunctionState._TEST_TRIGGER * 2**error_level def TestFunctionLengthCheckDefinition(self, lines, error_level): """Generate long function definition and check warnings are as expected. Args: lines: Number of lines to generate. error_level: --v setting for cpplint. """ trigger_level = self.TriggerLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( 'void test(int x)' + self.FunctionBody(lines), ('Small and focused functions are preferred: ' 'test() has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]' % (lines, trigger_level, error_level))) def TestFunctionLengthCheckDefinitionOK(self, lines): """Generate shorter function definition and check no warning is produced. Args: lines: Number of lines to generate. """ self.TestFunctionLengthsCheck( 'void test(int x)' + self.FunctionBody(lines), '') def TestFunctionLengthCheckAtErrorLevel(self, error_level): """Generate and check function at the trigger level for --v setting. Args: error_level: --v setting for cpplint. """ self.TestFunctionLengthCheckDefinition(self.TriggerLines(error_level), error_level) def TestFunctionLengthCheckBelowErrorLevel(self, error_level): """Generate and check function just below the trigger level for --v setting. Args: error_level: --v setting for cpplint. """ self.TestFunctionLengthCheckDefinition(self.TriggerLines(error_level)-1, error_level-1) def TestFunctionLengthCheckAboveErrorLevel(self, error_level): """Generate and check function just above the trigger level for --v setting. Args: error_level: --v setting for cpplint. """ self.TestFunctionLengthCheckDefinition(self.TriggerLines(error_level)+1, error_level) def FunctionBody(self, number_of_lines): return ' {\n' + ' this_is_just_a_test();\n'*number_of_lines + '}' def FunctionBodyWithBlankLines(self, number_of_lines): return ' {\n' + ' this_is_just_a_test();\n\n'*number_of_lines + '}' def FunctionBodyWithNoLints(self, number_of_lines): return (' {\n' + ' this_is_just_a_test(); // NOLINT\n'*number_of_lines + '}') # Test line length checks. def testFunctionLengthCheckDeclaration(self): self.TestFunctionLengthsCheck( 'void test();', # Not a function definition '') def testFunctionLengthCheckDeclarationWithBlockFollowing(self): self.TestFunctionLengthsCheck( ('void test();\n' + self.FunctionBody(66)), # Not a function definition '') def testFunctionLengthCheckClassDefinition(self): self.TestFunctionLengthsCheck( # Not a function definition 'class Test' + self.FunctionBody(66) + ';', '') def testFunctionLengthCheckTrivial(self): self.TestFunctionLengthsCheck( 'void test() {}', # Not counted '') def testFunctionLengthCheckEmpty(self): self.TestFunctionLengthsCheck( 'void test() {\n}', '') def testFunctionLengthCheckDefinitionBelowSeverity0(self): old_verbosity = cpplint._SetVerboseLevel(0) self.TestFunctionLengthCheckDefinitionOK(self.TriggerLines(0)-1) cpplint._SetVerboseLevel(old_verbosity) def testFunctionLengthCheckDefinitionAtSeverity0(self): old_verbosity = cpplint._SetVerboseLevel(0) self.TestFunctionLengthCheckDefinitionOK(self.TriggerLines(0)) cpplint._SetVerboseLevel(old_verbosity) def testFunctionLengthCheckDefinitionAboveSeverity0(self): old_verbosity = cpplint._SetVerboseLevel(0) self.TestFunctionLengthCheckAboveErrorLevel(0) cpplint._SetVerboseLevel(old_verbosity) def testFunctionLengthCheckDefinitionBelowSeverity1v0(self): old_verbosity = cpplint._SetVerboseLevel(0) self.TestFunctionLengthCheckBelowErrorLevel(1) cpplint._SetVerboseLevel(old_verbosity) def testFunctionLengthCheckDefinitionAtSeverity1v0(self): old_verbosity = cpplint._SetVerboseLevel(0) self.TestFunctionLengthCheckAtErrorLevel(1) cpplint._SetVerboseLevel(old_verbosity) def testFunctionLengthCheckDefinitionBelowSeverity1(self): self.TestFunctionLengthCheckDefinitionOK(self.TriggerLines(1)-1) def testFunctionLengthCheckDefinitionAtSeverity1(self): self.TestFunctionLengthCheckDefinitionOK(self.TriggerLines(1)) def testFunctionLengthCheckDefinitionAboveSeverity1(self): self.TestFunctionLengthCheckAboveErrorLevel(1) def testFunctionLengthCheckDefinitionSeverity1PlusBlanks(self): error_level = 1 error_lines = self.TriggerLines(error_level) + 1 trigger_level = self.TriggerLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( 'void test_blanks(int x)' + self.FunctionBody(error_lines), ('Small and focused functions are preferred: ' 'test_blanks() has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]') % (error_lines, trigger_level, error_level)) def testFunctionLengthCheckComplexDefinitionSeverity1(self): error_level = 1 error_lines = self.TriggerLines(error_level) + 1 trigger_level = self.TriggerLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( ('my_namespace::my_other_namespace::MyVeryLongTypeName*\n' 'my_namespace::my_other_namespace::MyFunction(int arg1, char* arg2)' + self.FunctionBody(error_lines)), ('Small and focused functions are preferred: ' 'my_namespace::my_other_namespace::MyFunction()' ' has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]') % (error_lines, trigger_level, error_level)) def testFunctionLengthCheckDefinitionSeverity1ForTest(self): error_level = 1 error_lines = self.TestLines(error_level) + 1 trigger_level = self.TestLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( 'TEST_F(Test, Mutator)' + self.FunctionBody(error_lines), ('Small and focused functions are preferred: ' 'TEST_F(Test, Mutator) has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]') % (error_lines, trigger_level, error_level)) def testFunctionLengthCheckDefinitionSeverity1ForSplitLineTest(self): error_level = 1 error_lines = self.TestLines(error_level) + 1 trigger_level = self.TestLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( ('TEST_F(GoogleUpdateRecoveryRegistryProtectedTest,\n' ' FixGoogleUpdate_AllValues_MachineApp)' # note: 4 spaces + self.FunctionBody(error_lines)), ('Small and focused functions are preferred: ' 'TEST_F(GoogleUpdateRecoveryRegistryProtectedTest, ' # 1 space 'FixGoogleUpdate_AllValues_MachineApp) has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]') % (error_lines+1, trigger_level, error_level)) def testFunctionLengthCheckDefinitionSeverity1ForBadTestDoesntBreak(self): error_level = 1 error_lines = self.TestLines(error_level) + 1 trigger_level = self.TestLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( ('TEST_F(' + self.FunctionBody(error_lines)), ('Small and focused functions are preferred: ' 'TEST_F has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]') % (error_lines, trigger_level, error_level)) def testFunctionLengthCheckDefinitionSeverity1WithEmbeddedNoLints(self): error_level = 1 error_lines = self.TriggerLines(error_level)+1 trigger_level = self.TriggerLines(cpplint._VerboseLevel()) self.TestFunctionLengthsCheck( 'void test(int x)' + self.FunctionBodyWithNoLints(error_lines), ('Small and focused functions are preferred: ' 'test() has %d non-comment lines ' '(error triggered by exceeding %d lines).' ' [readability/fn_size] [%d]') % (error_lines, trigger_level, error_level)) def testFunctionLengthCheckDefinitionSeverity1WithNoLint(self): self.TestFunctionLengthsCheck( ('void test(int x)' + self.FunctionBody(self.TriggerLines(1)) + ' // NOLINT -- long function'), '') def testFunctionLengthCheckDefinitionBelowSeverity2(self): self.TestFunctionLengthCheckBelowErrorLevel(2) def testFunctionLengthCheckDefinitionSeverity2(self): self.TestFunctionLengthCheckAtErrorLevel(2) def testFunctionLengthCheckDefinitionAboveSeverity2(self): self.TestFunctionLengthCheckAboveErrorLevel(2) def testFunctionLengthCheckDefinitionBelowSeverity3(self): self.TestFunctionLengthCheckBelowErrorLevel(3) def testFunctionLengthCheckDefinitionSeverity3(self): self.TestFunctionLengthCheckAtErrorLevel(3) def testFunctionLengthCheckDefinitionAboveSeverity3(self): self.TestFunctionLengthCheckAboveErrorLevel(3) def testFunctionLengthCheckDefinitionBelowSeverity4(self): self.TestFunctionLengthCheckBelowErrorLevel(4) def testFunctionLengthCheckDefinitionSeverity4(self): self.TestFunctionLengthCheckAtErrorLevel(4) def testFunctionLengthCheckDefinitionAboveSeverity4(self): self.TestFunctionLengthCheckAboveErrorLevel(4) def testFunctionLengthCheckDefinitionBelowSeverity5(self): self.TestFunctionLengthCheckBelowErrorLevel(5) def testFunctionLengthCheckDefinitionAtSeverity5(self): self.TestFunctionLengthCheckAtErrorLevel(5) def testFunctionLengthCheckDefinitionAboveSeverity5(self): self.TestFunctionLengthCheckAboveErrorLevel(5) def testFunctionLengthCheckDefinitionHugeLines(self): # 5 is the limit self.TestFunctionLengthCheckDefinition(self.TriggerLines(10), 5) def testFunctionLengthNotDeterminable(self): # Macro invocation without terminating semicolon. self.TestFunctionLengthsCheck( 'MACRO(arg)', '') # Macro with underscores self.TestFunctionLengthsCheck( 'MACRO_WITH_UNDERSCORES(arg1, arg2, arg3)', '') self.TestFunctionLengthsCheck( 'NonMacro(arg)', '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. Compute the minimum indent on all non blank lines and trim that from each, so that the block of text has no extra indentation. Args: text_block: a multiline string Returns: text_block with the common whitespace indent of each line removed. """ def CountLeadingWhitespace(s): count = 0 for c in s: if not c.isspace(): break count += 1 return count # find the minimum indent (except for blank lines) min_indent = min([CountLeadingWhitespace(line) for line in text_block.split('\n') if line]) return '\n'.join([line[min_indent:] for line in text_block.split('\n')]) class CloseExpressionTest(unittest.TestCase): def setUp(self): self.lines = cpplint.CleansedLines( # 1 2 3 4 5 # 0123456789012345678901234567890123456789012345678901234567890 ['// Line 0', 'inline RCULocked::ReadPtr::ReadPtr(const RCULocked* rcu) {', ' DCHECK(!(data & kFlagMask)) << "Error";', '}', '// Line 4', 'RCULocked::WritePtr::WritePtr(RCULocked* rcu)', ' : lock_(&rcu_->mutex_) {', '}', '// Line 8', 'template ', 'typename std::enable_if<', ' std::is_array::value && (std::extent::value > 0)>::type', 'MakeUnique(A&&... a) = delete;', '// Line 13', 'auto x = []() {};', '// Line 15', 'template ', 'friend bool operator==(const reffed_ptr& a,', ' const reffed_ptr& b) {', ' return a.get() == b.get();', '}', '// Line 21']) def testCloseExpression(self): # List of positions to test: # (start line, start position, end line, end position + 1) positions = [(1, 16, 1, 19), (1, 37, 1, 59), (1, 60, 3, 1), (2, 8, 2, 29), (2, 30, 22, -1), # Left shift operator (9, 9, 9, 36), (10, 23, 11, 59), (11, 54, 22, -1), # Greater than operator (14, 9, 14, 11), (14, 11, 14, 13), (14, 14, 14, 16), (17, 22, 18, 46), (18, 47, 20, 1)] for p in positions: (_, line, column) = cpplint.CloseExpression(self.lines, p[0], p[1]) self.assertEquals((p[2], p[3]), (line, column)) def testReverseCloseExpression(self): # List of positions to test: # (end line, end position, start line, start position) positions = [(1, 18, 1, 16), (1, 58, 1, 37), (2, 27, 2, 10), (2, 28, 2, 8), (6, 18, 0, -1), # -> operator (9, 35, 9, 9), (11, 54, 0, -1), # Greater than operator (11, 57, 11, 31), (14, 10, 14, 9), (14, 12, 14, 11), (14, 15, 14, 14), (18, 45, 17, 22), (20, 0, 18, 47)] for p in positions: (_, line, column) = cpplint.ReverseCloseExpression(self.lines, p[0], p[1]) self.assertEquals((p[2], p[3]), (line, column)) class NestingStateTest(unittest.TestCase): def setUp(self): self.nesting_state = cpplint.NestingState() self.error_collector = ErrorCollector(self.assert_) def UpdateWithLines(self, lines): clean_lines = cpplint.CleansedLines(lines) for line in xrange(clean_lines.NumLines()): self.nesting_state.Update('test.cc', clean_lines, line, self.error_collector) def testEmpty(self): self.UpdateWithLines([]) self.assertEquals(self.nesting_state.stack, []) def testNamespace(self): self.UpdateWithLines(['namespace {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._NamespaceInfo)) self.assertTrue(self.nesting_state.stack[0].seen_open_brace) self.assertEquals(self.nesting_state.stack[0].name, '') self.UpdateWithLines(['namespace outer { namespace inner']) self.assertEquals(len(self.nesting_state.stack), 3) self.assertTrue(self.nesting_state.stack[0].seen_open_brace) self.assertTrue(self.nesting_state.stack[1].seen_open_brace) self.assertFalse(self.nesting_state.stack[2].seen_open_brace) self.assertEquals(self.nesting_state.stack[0].name, '') self.assertEquals(self.nesting_state.stack[1].name, 'outer') self.assertEquals(self.nesting_state.stack[2].name, 'inner') self.UpdateWithLines(['{']) self.assertTrue(self.nesting_state.stack[2].seen_open_brace) self.UpdateWithLines(['}', '}}']) self.assertEquals(len(self.nesting_state.stack), 0) def testDecoratedClass(self): self.UpdateWithLines(['class Decorated_123 API A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A') self.assertFalse(self.nesting_state.stack[0].is_derived) self.assertEquals(self.nesting_state.stack[0].class_indent, 0) self.UpdateWithLines(['}']) self.assertEquals(len(self.nesting_state.stack), 0) def testInnerClass(self): self.UpdateWithLines(['class A::B::C {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A::B::C') self.assertFalse(self.nesting_state.stack[0].is_derived) self.assertEquals(self.nesting_state.stack[0].class_indent, 0) self.UpdateWithLines(['}']) self.assertEquals(len(self.nesting_state.stack), 0) def testClass(self): self.UpdateWithLines(['class A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A') self.assertFalse(self.nesting_state.stack[0].is_derived) self.assertEquals(self.nesting_state.stack[0].class_indent, 0) self.UpdateWithLines(['};', 'struct B : public A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'B') self.assertTrue(self.nesting_state.stack[0].is_derived) self.UpdateWithLines(['};', 'class C', ': public A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'C') self.assertTrue(self.nesting_state.stack[0].is_derived) self.UpdateWithLines(['};', 'template']) self.assertEquals(len(self.nesting_state.stack), 0) self.UpdateWithLines(['class D {', ' class E {']) self.assertEquals(len(self.nesting_state.stack), 2) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'D') self.assertFalse(self.nesting_state.stack[0].is_derived) self.assertTrue(isinstance(self.nesting_state.stack[1], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[1].name, 'E') self.assertFalse(self.nesting_state.stack[1].is_derived) self.assertEquals(self.nesting_state.stack[1].class_indent, 2) self.assertEquals(self.nesting_state.InnermostClass().name, 'E') self.UpdateWithLines(['}', '}']) self.assertEquals(len(self.nesting_state.stack), 0) def testClassAccess(self): self.UpdateWithLines(['class A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].access, 'private') self.UpdateWithLines([' public:']) self.assertEquals(self.nesting_state.stack[0].access, 'public') self.UpdateWithLines([' protracted:']) self.assertEquals(self.nesting_state.stack[0].access, 'public') self.UpdateWithLines([' protected:']) self.assertEquals(self.nesting_state.stack[0].access, 'protected') self.UpdateWithLines([' private:']) self.assertEquals(self.nesting_state.stack[0].access, 'private') self.UpdateWithLines([' struct B {']) self.assertEquals(len(self.nesting_state.stack), 2) self.assertTrue(isinstance(self.nesting_state.stack[1], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[1].access, 'public') self.assertEquals(self.nesting_state.stack[0].access, 'private') self.UpdateWithLines([' protected :']) self.assertEquals(self.nesting_state.stack[1].access, 'protected') self.assertEquals(self.nesting_state.stack[0].access, 'private') self.UpdateWithLines([' }', '}']) self.assertEquals(len(self.nesting_state.stack), 0) def testStruct(self): self.UpdateWithLines(['struct A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A') self.assertFalse(self.nesting_state.stack[0].is_derived) self.UpdateWithLines(['}', 'void Func(struct B arg) {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertFalse(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.UpdateWithLines(['}']) self.assertEquals(len(self.nesting_state.stack), 0) def testPreprocessor(self): self.assertEquals(len(self.nesting_state.pp_stack), 0) self.UpdateWithLines(['#if MACRO1']) self.assertEquals(len(self.nesting_state.pp_stack), 1) self.UpdateWithLines(['#endif']) self.assertEquals(len(self.nesting_state.pp_stack), 0) self.UpdateWithLines(['#ifdef MACRO2']) self.assertEquals(len(self.nesting_state.pp_stack), 1) self.UpdateWithLines(['#else']) self.assertEquals(len(self.nesting_state.pp_stack), 1) self.UpdateWithLines(['#ifdef MACRO3']) self.assertEquals(len(self.nesting_state.pp_stack), 2) self.UpdateWithLines(['#elif MACRO4']) self.assertEquals(len(self.nesting_state.pp_stack), 2) self.UpdateWithLines(['#endif']) self.assertEquals(len(self.nesting_state.pp_stack), 1) self.UpdateWithLines(['#endif']) self.assertEquals(len(self.nesting_state.pp_stack), 0) self.UpdateWithLines(['#ifdef MACRO5', 'class A {', '#elif MACRO6', 'class B {', '#else', 'class C {', '#endif']) self.assertEquals(len(self.nesting_state.pp_stack), 0) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A') self.UpdateWithLines(['};']) self.assertEquals(len(self.nesting_state.stack), 0) self.UpdateWithLines(['class D', '#ifdef MACRO7']) self.assertEquals(len(self.nesting_state.pp_stack), 1) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'D') self.assertFalse(self.nesting_state.stack[0].is_derived) self.UpdateWithLines(['#elif MACRO8', ': public E']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[0].name, 'D') self.assertTrue(self.nesting_state.stack[0].is_derived) self.assertFalse(self.nesting_state.stack[0].seen_open_brace) self.UpdateWithLines(['#else', '{']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[0].name, 'D') self.assertFalse(self.nesting_state.stack[0].is_derived) self.assertTrue(self.nesting_state.stack[0].seen_open_brace) self.UpdateWithLines(['#endif']) self.assertEquals(len(self.nesting_state.pp_stack), 0) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[0].name, 'D') self.assertFalse(self.nesting_state.stack[0].is_derived) self.assertFalse(self.nesting_state.stack[0].seen_open_brace) self.UpdateWithLines([';']) self.assertEquals(len(self.nesting_state.stack), 0) def testTemplate(self): self.UpdateWithLines(['template >']) self.assertEquals(len(self.nesting_state.stack), 0) self.UpdateWithLines(['class A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A') self.UpdateWithLines(['};', 'template class B>', 'class C']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'C') self.UpdateWithLines([';']) self.assertEquals(len(self.nesting_state.stack), 0) self.UpdateWithLines(['class D : public Tmpl']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'D') self.UpdateWithLines(['{', '};']) self.assertEquals(len(self.nesting_state.stack), 0) self.UpdateWithLines(['template ', 'static void Func() {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertFalse(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.UpdateWithLines(['}', 'template class K {']) self.assertEquals(len(self.nesting_state.stack), 1) 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:']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.UpdateWithLines([' template ', ' class C >', ' : public A {']) self.assertEquals(len(self.nesting_state.stack), 2) self.assertTrue(isinstance(self.nesting_state.stack[1], cpplint._ClassInfo)) def testArguments(self): self.UpdateWithLines(['class A {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'A') self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.UpdateWithLines([' void Func(', ' struct X arg1,']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.UpdateWithLines([' struct X *arg2);']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.UpdateWithLines(['};']) self.assertEquals(len(self.nesting_state.stack), 0) self.UpdateWithLines(['struct B {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'B') self.UpdateWithLines(['#ifdef MACRO', ' void Func(', ' struct X arg1']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.UpdateWithLines(['#else']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.UpdateWithLines([' void Func(', ' struct X arg1']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.UpdateWithLines(['#endif']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.UpdateWithLines([' struct X *arg2);']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.UpdateWithLines(['};']) self.assertEquals(len(self.nesting_state.stack), 0) def testInlineAssembly(self): self.UpdateWithLines(['void CopyRow_SSE2(const uint8* src, uint8* dst,', ' int count) {']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._NO_ASM) self.UpdateWithLines([' asm volatile (']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._INSIDE_ASM) self.UpdateWithLines([' "sub %0,%1 \\n"', ' "1: \\n"', ' "movdqa (%0),%%xmm0 \\n"', ' "movdqa 0x10(%0),%%xmm1 \\n"', ' "movdqa %%xmm0,(%0,%1) \\n"', ' "movdqa %%xmm1,0x10(%0,%1) \\n"', ' "lea 0x20(%0),%0 \\n"', ' "sub $0x20,%2 \\n"', ' "jg 1b \\n"', ' : "+r"(src), // %0', ' "+r"(dst), // %1', ' "+r"(count) // %2', ' :', ' : "memory", "cc"']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._INSIDE_ASM) self.UpdateWithLines(['#if defined(__SSE2__)', ' , "xmm0", "xmm1"']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._INSIDE_ASM) self.UpdateWithLines(['#endif']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 1) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._INSIDE_ASM) self.UpdateWithLines([' );']) self.assertEquals(len(self.nesting_state.stack), 1) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._END_ASM) self.UpdateWithLines(['__asm {']) self.assertEquals(len(self.nesting_state.stack), 2) self.assertEquals(self.nesting_state.stack[-1].open_parentheses, 0) self.assertEquals(self.nesting_state.stack[-1].inline_asm, cpplint._BLOCK_ASM) self.UpdateWithLines(['}']) self.assertEquals(len(self.nesting_state.stack), 1) self.UpdateWithLines(['}']) self.assertEquals(len(self.nesting_state.stack), 0) class QuietTest(unittest.TestCase): def setUp(self): self.temp_dir = os.path.realpath(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. """ # Enable all filters, so we don't miss anything that is off by default. cpplint._DEFAULT_FILTERS = [] cpplint._cpplint_state.SetFilters('') # pylint: disable=C6409 def tearDown(): """A global check to make sure all error-categories have been tested. The main tearDown() routine is the only code we can guarantee will be run after all other tests have been executed. """ try: if _run_verifyallcategoriesseen: ErrorCollector(None).VerifyAllCategoriesAreSeen() except NameError: # If nobody set the global _run_verifyallcategoriesseen, then # we assume we should silently not run the test 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, # obviously we're not going to see all the error categories. So we # only run VerifyAllCategoriesAreSeen() when no commandline flags # are passed in. global _run_verifyallcategoriesseen _run_verifyallcategoriesseen = (len(sys.argv) == 1) setUp() unittest.main() tearDown() cpplint-1.5.5/dev-requirements000066400000000000000000000003561405143476300164300ustar00rootroot00000000000000# requirements to run development steps # also change in tox.ini flake8>=3.7.8 flake8-polyfill pylint>=1.8.4 tox>=3.0.0 tox-pyenv importlib-metadata>=0.12 # Below only run with python3, installed in tox.ini # mypy # coala # coala-bears cpplint-1.5.5/samples/000077500000000000000000000000001405143476300146465ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/000077500000000000000000000000001405143476300172535ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/LICENSE000066400000000000000000000024731405143476300202660ustar00rootroot00000000000000Boost 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. cpplint-1.5.5/samples/boost-sample/README.md000066400000000000000000000001211405143476300205240ustar00rootroot00000000000000# VLC sample code taken for regression testing from https://github.com/boostorg cpplint-1.5.5/samples/boost-sample/exclude.def000066400000000000000000000305231405143476300213670ustar00rootroot00000000000000--recursive --exclude=headers/* src 1 4 Done processing src/inspect/unnamed_namespace_check.hpp Done processing src/tr1/c_policy.hpp Total errors found: 106 src/inspect/unnamed_namespace_check.hpp:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_BOOST_SAMPLE_SRC_INSPECT_UNNAMED_NAMESPACE_CHECK_HPP_ [build/header_guard] [5] src/inspect/unnamed_namespace_check.hpp:14: Do not use unnamed namespaces in header files. See https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces for more information. [build/namespaces_headers] [4] src/inspect/unnamed_namespace_check.hpp:18: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:19: Closing ) should be moved to the previous line [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:21: Anonymous namespace should be terminated with "// namespace" [readability/namespace] [5] src/inspect/unnamed_namespace_check.hpp:21: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:26: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:27: Do not indent within a namespace [runtime/indentation_namespace] [4] src/inspect/unnamed_namespace_check.hpp:28: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:29: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:30: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:30: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:31: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:31: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:32: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:32: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:32: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:33: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:33: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:34: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:34: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:34: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:35: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:35: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:36: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:36: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:37: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:37: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:38: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:40: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:44: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:48: Lines should be <= 80 characters long [whitespace/line_length] [2] src/inspect/unnamed_namespace_check.hpp:49: Missing space before ( in for( [whitespace/parens] [5] src/inspect/unnamed_namespace_check.hpp:50: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:54: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:54: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:57: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] src/inspect/unnamed_namespace_check.hpp:59: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:60: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:51: Add #include for string [build/include_what_you_use] [4] 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] cpplint-1.5.5/samples/boost-sample/headers_inspect.def000066400000000000000000000114351405143476300230770ustar00rootroot00000000000000src/inspect/* 1 3 Done processing src/inspect/unnamed_namespace_check.hpp Total errors found: 40 src/inspect/unnamed_namespace_check.hpp:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_BOOST_SAMPLE_SRC_INSPECT_UNNAMED_NAMESPACE_CHECK_HPP_ [build/header_guard] [5] src/inspect/unnamed_namespace_check.hpp:14: Do not use unnamed namespaces in header files. See https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces for more information. [build/namespaces_headers] [4] src/inspect/unnamed_namespace_check.hpp:18: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:19: Closing ) should be moved to the previous line [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:21: Anonymous namespace should be terminated with "// namespace" [readability/namespace] [5] src/inspect/unnamed_namespace_check.hpp:21: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:26: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:27: Do not indent within a namespace [runtime/indentation_namespace] [4] src/inspect/unnamed_namespace_check.hpp:28: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:29: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:30: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:30: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:31: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:31: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:32: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:32: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:32: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:33: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:33: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:34: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:34: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:34: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:35: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:35: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:36: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:36: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:37: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:37: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:38: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:40: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/inspect/unnamed_namespace_check.hpp:44: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:48: Lines should be <= 80 characters long [whitespace/line_length] [2] src/inspect/unnamed_namespace_check.hpp:49: Missing space before ( in for( [whitespace/parens] [5] src/inspect/unnamed_namespace_check.hpp:50: { should almost always be at the end of the previous line [whitespace/braces] [4] src/inspect/unnamed_namespace_check.hpp:54: Extra space after ( in function call [whitespace/parens] [4] src/inspect/unnamed_namespace_check.hpp:54: Extra space before ) [whitespace/parens] [2] src/inspect/unnamed_namespace_check.hpp:57: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] src/inspect/unnamed_namespace_check.hpp:59: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:60: At least two spaces is best between code and comments [whitespace/comments] [2] src/inspect/unnamed_namespace_check.hpp:51: Add #include for string [build/include_what_you_use] [4] cpplint-1.5.5/samples/boost-sample/headers_simple.def000066400000000000000000000171061405143476300227240ustar00rootroot00000000000000src/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] cpplint-1.5.5/samples/boost-sample/include/000077500000000000000000000000001405143476300206765ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/include/boost/000077500000000000000000000000001405143476300220245ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/include/boost/math/000077500000000000000000000000001405143476300227555ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/include/boost/math/octonion.hpp000066400000000000000000007412621405143476300253320ustar00rootroot00000000000000// boost octonion.hpp header file // (C) Copyright Hubert Holin 2001. // Distributed under 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) // See http://www.boost.org for updates, documentation, and revision history. #ifndef BOOST_OCTONION_HPP #define BOOST_OCTONION_HPP #include namespace boost { namespace math { #define BOOST_OCTONION_ACCESSOR_GENERATOR(type) \ type real() const \ { \ return(a); \ } \ \ octonion unreal() const \ { \ return( octonion(static_cast(0),b,c,d,e,f,g,h)); \ } \ \ type R_component_1() const \ { \ return(a); \ } \ \ type R_component_2() const \ { \ return(b); \ } \ \ type R_component_3() const \ { \ return(c); \ } \ \ type R_component_4() const \ { \ return(d); \ } \ \ type R_component_5() const \ { \ return(e); \ } \ \ type R_component_6() const \ { \ return(f); \ } \ \ type R_component_7() const \ { \ return(g); \ } \ \ type R_component_8() const \ { \ return(h); \ } \ \ ::std::complex C_component_1() const \ { \ return(::std::complex(a,b)); \ } \ \ ::std::complex C_component_2() const \ { \ return(::std::complex(c,d)); \ } \ \ ::std::complex C_component_3() const \ { \ return(::std::complex(e,f)); \ } \ \ ::std::complex C_component_4() const \ { \ return(::std::complex(g,h)); \ } \ \ ::boost::math::quaternion H_component_1() const \ { \ return(::boost::math::quaternion(a,b,c,d)); \ } \ \ ::boost::math::quaternion H_component_2() const \ { \ return(::boost::math::quaternion(e,f,g,h)); \ } #define BOOST_OCTONION_MEMBER_ASSIGNMENT_GENERATOR(type) \ template \ octonion & operator = (octonion const & a_affecter) \ { \ a = static_cast(a_affecter.R_component_1()); \ b = static_cast(a_affecter.R_component_2()); \ c = static_cast(a_affecter.R_component_3()); \ d = static_cast(a_affecter.R_component_4()); \ e = static_cast(a_affecter.R_component_5()); \ f = static_cast(a_affecter.R_component_6()); \ g = static_cast(a_affecter.R_component_7()); \ h = static_cast(a_affecter.R_component_8()); \ \ return(*this); \ } \ \ octonion & operator = (octonion const & a_affecter) \ { \ a = a_affecter.a; \ b = a_affecter.b; \ c = a_affecter.c; \ d = a_affecter.d; \ e = a_affecter.e; \ f = a_affecter.f; \ g = a_affecter.g; \ h = a_affecter.h; \ \ return(*this); \ } \ \ octonion & operator = (type const & a_affecter) \ { \ a = a_affecter; \ \ b = c = d = e = f= g = h = static_cast(0); \ \ return(*this); \ } \ \ octonion & operator = (::std::complex const & a_affecter) \ { \ a = a_affecter.real(); \ b = a_affecter.imag(); \ \ c = d = e = f = g = h = static_cast(0); \ \ return(*this); \ } \ \ octonion & operator = (::boost::math::quaternion const & a_affecter) \ { \ a = a_affecter.R_component_1(); \ b = a_affecter.R_component_2(); \ c = a_affecter.R_component_3(); \ d = a_affecter.R_component_4(); \ \ e = f = g = h = static_cast(0); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_DATA_GENERATOR(type) \ type a; \ type b; \ type c; \ type d; \ type e; \ type f; \ type g; \ type h; \ template class octonion { public: typedef T value_type; // constructor for O seen as R^8 // (also default constructor) explicit octonion( T const & requested_a = T(), T const & requested_b = T(), T const & requested_c = T(), T const & requested_d = T(), T const & requested_e = T(), T const & requested_f = T(), T const & requested_g = T(), T const & requested_h = T()) : a(requested_a), b(requested_b), c(requested_c), d(requested_d), e(requested_e), f(requested_f), g(requested_g), h(requested_h) { // nothing to do! } // constructor for H seen as C^4 explicit octonion( ::std::complex const & z0, ::std::complex const & z1 = ::std::complex(), ::std::complex const & z2 = ::std::complex(), ::std::complex const & z3 = ::std::complex()) : a(z0.real()), b(z0.imag()), c(z1.real()), d(z1.imag()), e(z2.real()), f(z2.imag()), g(z3.real()), h(z3.imag()) { // nothing to do! } // constructor for O seen as H^2 explicit octonion( ::boost::math::quaternion const & q0, ::boost::math::quaternion const & q1 = ::boost::math::quaternion()) : a(q0.R_component_1()), b(q0.R_component_2()), c(q0.R_component_3()), d(q0.R_component_4()), e(q1.R_component_1()), f(q1.R_component_2()), g(q1.R_component_3()), h(q1.R_component_4()) { // nothing to do! } // UNtemplated copy constructor // (this is taken care of by the compiler itself) // templated copy constructor template explicit octonion(octonion const & a_recopier) : a(static_cast(a_recopier.R_component_1())), b(static_cast(a_recopier.R_component_2())), c(static_cast(a_recopier.R_component_3())), d(static_cast(a_recopier.R_component_4())), e(static_cast(a_recopier.R_component_5())), f(static_cast(a_recopier.R_component_6())), g(static_cast(a_recopier.R_component_7())), h(static_cast(a_recopier.R_component_8())) { // nothing to do! } // destructor // (this is taken care of by the compiler itself) // accessors // // Note: Like complex number, octonions do have a meaningful notion of "real part", // but unlike them there is no meaningful notion of "imaginary part". // Instead there is an "unreal part" which itself is an octonion, and usually // nothing simpler (as opposed to the complex number case). // However, for practicallity, there are accessors for the other components // (these are necessary for the templated copy constructor, for instance). BOOST_OCTONION_ACCESSOR_GENERATOR(T) // assignment operators BOOST_OCTONION_MEMBER_ASSIGNMENT_GENERATOR(T) // other assignment-related operators // // NOTE: Octonion multiplication is *NOT* commutative; // symbolically, "q *= rhs;" means "q = q * rhs;" // and "q /= rhs;" means "q = q * inverse_of(rhs);"; // octonion multiplication is also *NOT* associative octonion & operator += (T const & rhs) { T at = a + rhs; // exception guard a = at; return(*this); } octonion & operator += (::std::complex const & rhs) { T at = a + rhs.real(); // exception guard T bt = b + rhs.imag(); // exception guard a = at; b = bt; return(*this); } octonion & operator += (::boost::math::quaternion const & rhs) { T at = a + rhs.R_component_1(); // exception guard T bt = b + rhs.R_component_2(); // exception guard T ct = c + rhs.R_component_3(); // exception guard T dt = d + rhs.R_component_4(); // exception guard a = at; b = bt; c = ct; d = dt; return(*this); } template octonion & operator += (octonion const & rhs) { T at = a + static_cast(rhs.R_component_1()); // exception guard T bt = b + static_cast(rhs.R_component_2()); // exception guard T ct = c + static_cast(rhs.R_component_3()); // exception guard T dt = d + static_cast(rhs.R_component_4()); // exception guard T et = e + static_cast(rhs.R_component_5()); // exception guard T ft = f + static_cast(rhs.R_component_6()); // exception guard T gt = g + static_cast(rhs.R_component_7()); // exception guard T ht = h + static_cast(rhs.R_component_8()); // exception guard a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator -= (T const & rhs) { T at = a - rhs; // exception guard a = at; return(*this); } octonion & operator -= (::std::complex const & rhs) { T at = a - rhs.real(); // exception guard T bt = b - rhs.imag(); // exception guard a = at; b = bt; return(*this); } octonion & operator -= (::boost::math::quaternion const & rhs) { T at = a - rhs.R_component_1(); // exception guard T bt = b - rhs.R_component_2(); // exception guard T ct = c - rhs.R_component_3(); // exception guard T dt = d - rhs.R_component_4(); // exception guard a = at; b = bt; c = ct; d = dt; return(*this); } template octonion & operator -= (octonion const & rhs) { T at = a - static_cast(rhs.R_component_1()); // exception guard T bt = b - static_cast(rhs.R_component_2()); // exception guard T ct = c - static_cast(rhs.R_component_3()); // exception guard T dt = d - static_cast(rhs.R_component_4()); // exception guard T et = e - static_cast(rhs.R_component_5()); // exception guard T ft = f - static_cast(rhs.R_component_6()); // exception guard T gt = g - static_cast(rhs.R_component_7()); // exception guard T ht = h - static_cast(rhs.R_component_8()); // exception guard a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator *= (T const & rhs) { T at = a * rhs; // exception guard T bt = b * rhs; // exception guard T ct = c * rhs; // exception guard T dt = d * rhs; // exception guard T et = e * rhs; // exception guard T ft = f * rhs; // exception guard T gt = g * rhs; // exception guard T ht = h * rhs; // exception guard a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator *= (::std::complex const & rhs) { T ar = rhs.real(); T br = rhs.imag(); T at = +a*ar-b*br; T bt = +a*br+b*ar; T ct = +c*ar+d*br; T dt = -c*br+d*ar; T et = +e*ar+f*br; T ft = -e*br+f*ar; T gt = +g*ar-h*br; T ht = +g*br+h*ar; a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator *= (::boost::math::quaternion const & rhs) { T ar = rhs.R_component_1(); T br = rhs.R_component_2(); T cr = rhs.R_component_2(); T dr = rhs.R_component_2(); T at = +a*ar-b*br-c*cr-d*dr; T bt = +a*br+b*ar+c*dr-d*cr; T ct = +a*cr-b*dr+c*ar+d*br; T dt = +a*dr+b*cr-c*br+d*ar; T et = +e*ar+f*br+g*cr+h*dr; T ft = -e*br+f*ar-g*dr+h*cr; T gt = -e*cr+f*dr+g*ar-h*br; T ht = -e*dr-f*cr+g*br+h*ar; a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } template octonion & operator *= (octonion const & rhs) { T ar = static_cast(rhs.R_component_1()); T br = static_cast(rhs.R_component_2()); T cr = static_cast(rhs.R_component_3()); T dr = static_cast(rhs.R_component_4()); T er = static_cast(rhs.R_component_5()); T fr = static_cast(rhs.R_component_6()); T gr = static_cast(rhs.R_component_7()); T hr = static_cast(rhs.R_component_8()); T at = +a*ar-b*br-c*cr-d*dr-e*er-f*fr-g*gr-h*hr; T bt = +a*br+b*ar+c*dr-d*cr+e*fr-f*er-g*hr+h*gr; T ct = +a*cr-b*dr+c*ar+d*br+e*gr+f*hr-g*er-h*fr; T dt = +a*dr+b*cr-c*br+d*ar+e*hr-f*gr+g*fr-h*er; T et = +a*er-b*fr-c*gr-d*hr+e*ar+f*br+g*cr+h*dr; T ft = +a*fr+b*er-c*hr+d*gr-e*br+f*ar-g*dr+h*cr; T gt = +a*gr+b*hr+c*er-d*fr-e*cr+f*dr+g*ar-h*br; T ht = +a*hr-b*gr+c*fr+d*er-e*dr-f*cr+g*br+h*ar; a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator /= (T const & rhs) { T at = a / rhs; // exception guard T bt = b / rhs; // exception guard T ct = c / rhs; // exception guard T dt = d / rhs; // exception guard T et = e / rhs; // exception guard T ft = f / rhs; // exception guard T gt = g / rhs; // exception guard T ht = h / rhs; // exception guard a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator /= (::std::complex const & rhs) { T ar = rhs.real(); T br = rhs.imag(); T denominator = ar*ar+br*br; T at = (+a*ar-b*br)/denominator; T bt = (-a*br+b*ar)/denominator; T ct = (+c*ar-d*br)/denominator; T dt = (+c*br+d*ar)/denominator; T et = (+e*ar-f*br)/denominator; T ft = (+e*br+f*ar)/denominator; T gt = (+g*ar+h*br)/denominator; T ht = (+g*br+h*ar)/denominator; a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } octonion & operator /= (::boost::math::quaternion const & rhs) { T ar = rhs.R_component_1(); T br = rhs.R_component_2(); T cr = rhs.R_component_2(); T dr = rhs.R_component_2(); T denominator = ar*ar+br*br+cr*cr+dr*dr; T at = (+a*ar+b*br+c*cr+d*dr)/denominator; T bt = (-a*br+b*ar-c*dr+d*cr)/denominator; T ct = (-a*cr+b*dr+c*ar-d*br)/denominator; T dt = (-a*dr-b*cr+c*br+d*ar)/denominator; T et = (+e*ar-f*br-g*cr-h*dr)/denominator; T ft = (+e*br+f*ar+g*dr-h*cr)/denominator; T gt = (+e*cr-f*dr+g*ar+h*br)/denominator; T ht = (+e*dr+f*cr-g*br+h*ar)/denominator; a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } template octonion & operator /= (octonion const & rhs) { T ar = static_cast(rhs.R_component_1()); T br = static_cast(rhs.R_component_2()); T cr = static_cast(rhs.R_component_3()); T dr = static_cast(rhs.R_component_4()); T er = static_cast(rhs.R_component_5()); T fr = static_cast(rhs.R_component_6()); T gr = static_cast(rhs.R_component_7()); T hr = static_cast(rhs.R_component_8()); T denominator = ar*ar+br*br+cr*cr+dr*dr+er*er+fr*fr+gr*gr+hr*hr; T at = (+a*ar+b*br+c*cr+d*dr+e*er+f*fr+g*gr+h*hr)/denominator; T bt = (-a*br+b*ar-c*dr+d*cr-e*fr+f*er+g*hr-h*gr)/denominator; T ct = (-a*cr+b*dr+c*ar-d*br-e*gr-f*hr+g*er+h*fr)/denominator; T dt = (-a*dr-b*cr+c*br+d*ar-e*hr+f*gr-g*fr+h*er)/denominator; T et = (-a*er+b*fr+c*gr+d*hr+e*ar-f*br-g*cr-h*dr)/denominator; T ft = (-a*fr-b*er+c*hr-d*gr+e*br+f*ar+g*dr-h*cr)/denominator; T gt = (-a*gr-b*hr-c*er+d*fr+e*cr-f*dr+g*ar+h*br)/denominator; T ht = (-a*hr+b*gr-c*fr-d*er+e*dr+f*cr-g*br+h*ar)/denominator; a = at; b = bt; c = ct; d = dt; e = et; f = ft; g = gt; h = ht; return(*this); } protected: BOOST_OCTONION_MEMBER_DATA_GENERATOR(T) private: }; // declaration of octonion specialization template<> class octonion; template<> class octonion; template<> class octonion; // helper templates for converting copy constructors (declaration) namespace detail { template< typename T, typename U > octonion octonion_type_converter(octonion const & rhs); } // implementation of octonion specialization #define BOOST_OCTONION_CONSTRUCTOR_GENERATOR(type) \ explicit octonion( type const & requested_a = static_cast(0), \ type const & requested_b = static_cast(0), \ type const & requested_c = static_cast(0), \ type const & requested_d = static_cast(0), \ type const & requested_e = static_cast(0), \ type const & requested_f = static_cast(0), \ type const & requested_g = static_cast(0), \ type const & requested_h = static_cast(0)) \ : a(requested_a), \ b(requested_b), \ c(requested_c), \ d(requested_d), \ e(requested_e), \ f(requested_f), \ g(requested_g), \ h(requested_h) \ { \ } \ \ explicit octonion( ::std::complex const & z0, \ ::std::complex const & z1 = ::std::complex(), \ ::std::complex const & z2 = ::std::complex(), \ ::std::complex const & z3 = ::std::complex()) \ : a(z0.real()), \ b(z0.imag()), \ c(z1.real()), \ d(z1.imag()), \ e(z2.real()), \ f(z2.imag()), \ g(z3.real()), \ h(z3.imag()) \ { \ } \ \ explicit octonion( ::boost::math::quaternion const & q0, \ ::boost::math::quaternion const & q1 = ::boost::math::quaternion()) \ : a(q0.R_component_1()), \ b(q0.R_component_2()), \ c(q0.R_component_3()), \ d(q0.R_component_4()), \ e(q1.R_component_1()), \ f(q1.R_component_2()), \ g(q1.R_component_3()), \ h(q1.R_component_4()) \ { \ } #define BOOST_OCTONION_MEMBER_ADD_GENERATOR_1(type) \ octonion & operator += (type const & rhs) \ { \ a += rhs; \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_ADD_GENERATOR_2(type) \ octonion & operator += (::std::complex const & rhs) \ { \ a += rhs.real(); \ b += rhs.imag(); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_ADD_GENERATOR_3(type) \ octonion & operator += (::boost::math::quaternion const & rhs) \ { \ a += rhs.R_component_1(); \ b += rhs.R_component_2(); \ c += rhs.R_component_3(); \ d += rhs.R_component_4(); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_ADD_GENERATOR_4(type) \ template \ octonion & operator += (octonion const & rhs) \ { \ a += static_cast(rhs.R_component_1()); \ b += static_cast(rhs.R_component_2()); \ c += static_cast(rhs.R_component_3()); \ d += static_cast(rhs.R_component_4()); \ e += static_cast(rhs.R_component_5()); \ f += static_cast(rhs.R_component_6()); \ g += static_cast(rhs.R_component_7()); \ h += static_cast(rhs.R_component_8()); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_SUB_GENERATOR_1(type) \ octonion & operator -= (type const & rhs) \ { \ a -= rhs; \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_SUB_GENERATOR_2(type) \ octonion & operator -= (::std::complex const & rhs) \ { \ a -= rhs.real(); \ b -= rhs.imag(); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_SUB_GENERATOR_3(type) \ octonion & operator -= (::boost::math::quaternion const & rhs) \ { \ a -= rhs.R_component_1(); \ b -= rhs.R_component_2(); \ c -= rhs.R_component_3(); \ d -= rhs.R_component_4(); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_SUB_GENERATOR_4(type) \ template \ octonion & operator -= (octonion const & rhs) \ { \ a -= static_cast(rhs.R_component_1()); \ b -= static_cast(rhs.R_component_2()); \ c -= static_cast(rhs.R_component_3()); \ d -= static_cast(rhs.R_component_4()); \ e -= static_cast(rhs.R_component_5()); \ f -= static_cast(rhs.R_component_6()); \ g -= static_cast(rhs.R_component_7()); \ h -= static_cast(rhs.R_component_8()); \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_MUL_GENERATOR_1(type) \ octonion & operator *= (type const & rhs) \ { \ a *= rhs; \ b *= rhs; \ c *= rhs; \ d *= rhs; \ e *= rhs; \ f *= rhs; \ g *= rhs; \ h *= rhs; \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_MUL_GENERATOR_2(type) \ octonion & operator *= (::std::complex const & rhs) \ { \ type ar = rhs.real(); \ type br = rhs.imag(); \ \ type at = +a*ar-b*br; \ type bt = +a*br+b*ar; \ type ct = +c*ar+d*br; \ type dt = -c*br+d*ar; \ type et = +e*ar+f*br; \ type ft = -e*br+f*ar; \ type gt = +g*ar-h*br; \ type ht = +g*br+h*ar; \ \ a = at; \ b = bt; \ c = ct; \ d = dt; \ e = et; \ f = ft; \ g = gt; \ h = ht; \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_MUL_GENERATOR_3(type) \ octonion & operator *= (::boost::math::quaternion const & rhs) \ { \ type ar = rhs.R_component_1(); \ type br = rhs.R_component_2(); \ type cr = rhs.R_component_2(); \ type dr = rhs.R_component_2(); \ \ type at = +a*ar-b*br-c*cr-d*dr; \ type bt = +a*br+b*ar+c*dr-d*cr; \ type ct = +a*cr-b*dr+c*ar+d*br; \ type dt = +a*dr+b*cr-c*br+d*ar; \ type et = +e*ar+f*br+g*cr+h*dr; \ type ft = -e*br+f*ar-g*dr+h*cr; \ type gt = -e*cr+f*dr+g*ar-h*br; \ type ht = -e*dr-f*cr+g*br+h*ar; \ \ a = at; \ b = bt; \ c = ct; \ d = dt; \ e = et; \ f = ft; \ g = gt; \ h = ht; \ \ return(*this); \ } #define BOOST_OCTONION_MEMBER_MUL_GENERATOR_4(type) \ template \ octonion & operator *= (octonion const & rhs) \ { \ type ar = static_cast(rhs.R_component_1()); \ type br = static_cast(rhs.R_component_2()); \ type cr = static_cast(rhs.R_component_3()); \ type dr = static_cast(rhs.R_component_4()); \ type er = static_cast(rhs.R_component_5()); \ type fr = static_cast(rhs.R_component_6()); \ type gr = static_cast(rhs.R_component_7()); \ type hr = static_cast(rhs.R_component_8()); \ \ type at = +a*ar-b*br-c*cr-d*dr-e*er-f*fr-g*gr-h*hr; \ type bt = +a*br+b*ar+c*dr-d*cr+e*fr-f*er-g*hr+h*gr; \ type ct = +a*cr-b*dr+c*ar+d*br+e*gr+f*hr-g*er-h*fr; \ type dt = +a*dr+b*cr-c*br+d*ar+e*hr-f*gr+g*fr-h*er; \ type et = +a*er-b*fr-c*gr-d*hr+e*ar+f*br+g*cr+h*dr; \ type ft = +a*fr+b*er-c*hr+d*gr-e*br+f*ar-g*dr+h*cr; \ type gt = +a*gr+b*hr+c*er-d*fr-e*cr+f*dr+g*ar-h*br; \ type ht = +a*hr-b*gr+c*fr+d*er-e*dr-f*cr+g*br+h*ar; \ \ a = at; \ b = bt; \ c = ct; \ d = dt; \ e = et; \ f = ft; \ g = gt; \ h = ht; \ \ return(*this); \ } // There is quite a lot of repetition in the code below. This is intentional. // The last conditional block is the normal form, and the others merely // consist of workarounds for various compiler deficiencies. Hopefuly, when // more compilers are conformant and we can retire support for those that are // not, we will be able to remove the clutter. This is makes the situation // (painfully) explicit. #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_1(type) \ octonion & operator /= (type const & rhs) \ { \ a /= rhs; \ b /= rhs; \ c /= rhs; \ d /= rhs; \ \ return(*this); \ } #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_2(type) \ octonion & operator /= (::std::complex const & rhs) \ { \ using ::std::valarray; \ using ::std::abs; \ \ valarray tr(2); \ \ tr[0] = rhs.real(); \ tr[1] = rhs.imag(); \ \ type mixam = static_cast(1)/(abs(tr).max)(); \ \ tr *= mixam; \ \ valarray tt(8); \ \ tt[0] = +a*tr[0]-b*tr[1]; \ tt[1] = -a*tr[1]+b*tr[0]; \ tt[2] = +c*tr[0]-d*tr[1]; \ tt[3] = +c*tr[1]+d*tr[0]; \ tt[4] = +e*tr[0]-f*tr[1]; \ tt[5] = +e*tr[1]+f*tr[0]; \ tt[6] = +g*tr[0]+h*tr[1]; \ tt[7] = +g*tr[1]+h*tr[0]; \ \ tr *= tr; \ \ tt *= (mixam/tr.sum()); \ \ a = tt[0]; \ b = tt[1]; \ c = tt[2]; \ d = tt[3]; \ e = tt[4]; \ f = tt[5]; \ g = tt[6]; \ h = tt[7]; \ \ return(*this); \ } #else #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_2(type) \ octonion & operator /= (::std::complex const & rhs) \ { \ using ::std::valarray; \ \ valarray tr(2); \ \ tr[0] = rhs.real(); \ tr[1] = rhs.imag(); \ \ type mixam = static_cast(1)/(abs(tr).max)(); \ \ tr *= mixam; \ \ valarray tt(8); \ \ tt[0] = +a*tr[0]-b*tr[1]; \ tt[1] = -a*tr[1]+b*tr[0]; \ tt[2] = +c*tr[0]-d*tr[1]; \ tt[3] = +c*tr[1]+d*tr[0]; \ tt[4] = +e*tr[0]-f*tr[1]; \ tt[5] = +e*tr[1]+f*tr[0]; \ tt[6] = +g*tr[0]+h*tr[1]; \ tt[7] = +g*tr[1]+h*tr[0]; \ \ tr *= tr; \ \ tt *= (mixam/tr.sum()); \ \ a = tt[0]; \ b = tt[1]; \ c = tt[2]; \ d = tt[3]; \ e = tt[4]; \ f = tt[5]; \ g = tt[6]; \ h = tt[7]; \ \ return(*this); \ } #endif /* BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP */ #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_3(type) \ octonion & operator /= (::boost::math::quaternion const & rhs) \ { \ using ::std::valarray; \ using ::std::abs; \ \ valarray tr(4); \ \ tr[0] = static_cast(rhs.R_component_1()); \ tr[1] = static_cast(rhs.R_component_2()); \ tr[2] = static_cast(rhs.R_component_3()); \ tr[3] = static_cast(rhs.R_component_4()); \ \ type mixam = static_cast(1)/(abs(tr).max)(); \ \ tr *= mixam; \ \ valarray tt(8); \ \ tt[0] = +a*tr[0]+b*tr[1]+c*tr[2]+d*tr[3]; \ tt[1] = -a*tr[1]+b*tr[0]-c*tr[3]+d*tr[2]; \ tt[2] = -a*tr[2]+b*tr[3]+c*tr[0]-d*tr[1]; \ tt[3] = -a*tr[3]-b*tr[2]+c*tr[1]+d*tr[0]; \ tt[4] = +e*tr[0]-f*tr[1]-g*tr[2]-h*tr[3]; \ tt[5] = +e*tr[1]+f*tr[0]+g*tr[3]-h*tr[2]; \ tt[6] = +e*tr[2]-f*tr[3]+g*tr[0]+h*tr[1]; \ tt[7] = +e*tr[3]+f*tr[2]-g*tr[1]+h*tr[0]; \ \ tr *= tr; \ \ tt *= (mixam/tr.sum()); \ \ a = tt[0]; \ b = tt[1]; \ c = tt[2]; \ d = tt[3]; \ e = tt[4]; \ f = tt[5]; \ g = tt[6]; \ h = tt[7]; \ \ return(*this); \ } #else #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_3(type) \ octonion & operator /= (::boost::math::quaternion const & rhs) \ { \ using ::std::valarray; \ \ valarray tr(4); \ \ tr[0] = static_cast(rhs.R_component_1()); \ tr[1] = static_cast(rhs.R_component_2()); \ tr[2] = static_cast(rhs.R_component_3()); \ tr[3] = static_cast(rhs.R_component_4()); \ \ type mixam = static_cast(1)/(abs(tr).max)(); \ \ tr *= mixam; \ \ valarray tt(8); \ \ tt[0] = +a*tr[0]+b*tr[1]+c*tr[2]+d*tr[3]; \ tt[1] = -a*tr[1]+b*tr[0]-c*tr[3]+d*tr[2]; \ tt[2] = -a*tr[2]+b*tr[3]+c*tr[0]-d*tr[1]; \ tt[3] = -a*tr[3]-b*tr[2]+c*tr[1]+d*tr[0]; \ tt[4] = +e*tr[0]-f*tr[1]-g*tr[2]-h*tr[3]; \ tt[5] = +e*tr[1]+f*tr[0]+g*tr[3]-h*tr[2]; \ tt[6] = +e*tr[2]-f*tr[3]+g*tr[0]+h*tr[1]; \ tt[7] = +e*tr[3]+f*tr[2]-g*tr[1]+h*tr[0]; \ \ tr *= tr; \ \ tt *= (mixam/tr.sum()); \ \ a = tt[0]; \ b = tt[1]; \ c = tt[2]; \ d = tt[3]; \ e = tt[4]; \ f = tt[5]; \ g = tt[6]; \ h = tt[7]; \ \ return(*this); \ } #endif /* BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP */ #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_4(type) \ template \ octonion & operator /= (octonion const & rhs) \ { \ using ::std::valarray; \ using ::std::abs; \ \ valarray tr(8); \ \ tr[0] = static_cast(rhs.R_component_1()); \ tr[1] = static_cast(rhs.R_component_2()); \ tr[2] = static_cast(rhs.R_component_3()); \ tr[3] = static_cast(rhs.R_component_4()); \ tr[4] = static_cast(rhs.R_component_5()); \ tr[5] = static_cast(rhs.R_component_6()); \ tr[6] = static_cast(rhs.R_component_7()); \ tr[7] = static_cast(rhs.R_component_8()); \ \ type mixam = static_cast(1)/(abs(tr).max)(); \ \ tr *= mixam; \ \ valarray tt(8); \ \ tt[0] = +a*tr[0]+b*tr[1]+c*tr[2]+d*tr[3]+e*tr[4]+f*tr[5]+g*tr[6]+h*tr[7]; \ tt[1] = -a*tr[1]+b*tr[0]-c*tr[3]+d*tr[2]-e*tr[5]+f*tr[4]+g*tr[7]-h*tr[6]; \ tt[2] = -a*tr[2]+b*tr[3]+c*tr[0]-d*tr[1]-e*tr[6]-f*tr[7]+g*tr[4]+h*tr[5]; \ tt[3] = -a*tr[3]-b*tr[2]+c*tr[1]+d*tr[0]-e*tr[7]+f*tr[6]-g*tr[5]+h*tr[4]; \ tt[4] = -a*tr[4]+b*tr[5]+c*tr[6]+d*tr[7]+e*tr[0]-f*tr[1]-g*tr[2]-h*tr[3]; \ tt[5] = -a*tr[5]-b*tr[4]+c*tr[7]-d*tr[6]+e*tr[1]+f*tr[0]+g*tr[3]-h*tr[2]; \ tt[6] = -a*tr[6]-b*tr[7]-c*tr[4]+d*tr[5]+e*tr[2]-f*tr[3]+g*tr[0]+h*tr[1]; \ tt[7] = -a*tr[7]+b*tr[6]-c*tr[5]-d*tr[4]+e*tr[3]+f*tr[2]-g*tr[1]+h*tr[0]; \ \ tr *= tr; \ \ tt *= (mixam/tr.sum()); \ \ a = tt[0]; \ b = tt[1]; \ c = tt[2]; \ d = tt[3]; \ e = tt[4]; \ f = tt[5]; \ g = tt[6]; \ h = tt[7]; \ \ return(*this); \ } #else #define BOOST_OCTONION_MEMBER_DIV_GENERATOR_4(type) \ template \ octonion & operator /= (octonion const & rhs) \ { \ using ::std::valarray; \ \ valarray tr(8); \ \ tr[0] = static_cast(rhs.R_component_1()); \ tr[1] = static_cast(rhs.R_component_2()); \ tr[2] = static_cast(rhs.R_component_3()); \ tr[3] = static_cast(rhs.R_component_4()); \ tr[4] = static_cast(rhs.R_component_5()); \ tr[5] = static_cast(rhs.R_component_6()); \ tr[6] = static_cast(rhs.R_component_7()); \ tr[7] = static_cast(rhs.R_component_8()); \ \ type mixam = static_cast(1)/(abs(tr).max)(); \ \ tr *= mixam; \ \ valarray tt(8); \ \ tt[0] = +a*tr[0]+b*tr[1]+c*tr[2]+d*tr[3]+e*tr[4]+f*tr[5]+g*tr[6]+h*tr[7]; \ tt[1] = -a*tr[1]+b*tr[0]-c*tr[3]+d*tr[2]-e*tr[5]+f*tr[4]+g*tr[7]-h*tr[6]; \ tt[2] = -a*tr[2]+b*tr[3]+c*tr[0]-d*tr[1]-e*tr[6]-f*tr[7]+g*tr[4]+h*tr[5]; \ tt[3] = -a*tr[3]-b*tr[2]+c*tr[1]+d*tr[0]-e*tr[7]+f*tr[6]-g*tr[5]+h*tr[4]; \ tt[4] = -a*tr[4]+b*tr[5]+c*tr[6]+d*tr[7]+e*tr[0]-f*tr[1]-g*tr[2]-h*tr[3]; \ tt[5] = -a*tr[5]-b*tr[4]+c*tr[7]-d*tr[6]+e*tr[1]+f*tr[0]+g*tr[3]-h*tr[2]; \ tt[6] = -a*tr[6]-b*tr[7]-c*tr[4]+d*tr[5]+e*tr[2]-f*tr[3]+g*tr[0]+h*tr[1]; \ tt[7] = -a*tr[7]+b*tr[6]-c*tr[5]-d*tr[4]+e*tr[3]+f*tr[2]-g*tr[1]+h*tr[0]; \ \ tr *= tr; \ \ tt *= (mixam/tr.sum()); \ \ a = tt[0]; \ b = tt[1]; \ c = tt[2]; \ d = tt[3]; \ e = tt[4]; \ f = tt[5]; \ g = tt[6]; \ h = tt[7]; \ \ return(*this); \ } #endif /* BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP */ #define BOOST_OCTONION_MEMBER_ADD_GENERATOR(type) \ BOOST_OCTONION_MEMBER_ADD_GENERATOR_1(type) \ BOOST_OCTONION_MEMBER_ADD_GENERATOR_2(type) \ BOOST_OCTONION_MEMBER_ADD_GENERATOR_3(type) \ BOOST_OCTONION_MEMBER_ADD_GENERATOR_4(type) #define BOOST_OCTONION_MEMBER_SUB_GENERATOR(type) \ BOOST_OCTONION_MEMBER_SUB_GENERATOR_1(type) \ BOOST_OCTONION_MEMBER_SUB_GENERATOR_2(type) \ BOOST_OCTONION_MEMBER_SUB_GENERATOR_3(type) \ BOOST_OCTONION_MEMBER_SUB_GENERATOR_4(type) #define BOOST_OCTONION_MEMBER_MUL_GENERATOR(type) \ BOOST_OCTONION_MEMBER_MUL_GENERATOR_1(type) \ BOOST_OCTONION_MEMBER_MUL_GENERATOR_2(type) \ BOOST_OCTONION_MEMBER_MUL_GENERATOR_3(type) \ BOOST_OCTONION_MEMBER_MUL_GENERATOR_4(type) #define BOOST_OCTONION_MEMBER_DIV_GENERATOR(type) \ BOOST_OCTONION_MEMBER_DIV_GENERATOR_1(type) \ BOOST_OCTONION_MEMBER_DIV_GENERATOR_2(type) \ BOOST_OCTONION_MEMBER_DIV_GENERATOR_3(type) \ BOOST_OCTONION_MEMBER_DIV_GENERATOR_4(type) #define BOOST_OCTONION_MEMBER_ALGEBRAIC_GENERATOR(type) \ BOOST_OCTONION_MEMBER_ADD_GENERATOR(type) \ BOOST_OCTONION_MEMBER_SUB_GENERATOR(type) \ BOOST_OCTONION_MEMBER_MUL_GENERATOR(type) \ BOOST_OCTONION_MEMBER_DIV_GENERATOR(type) template<> class octonion { public: typedef float value_type; BOOST_OCTONION_CONSTRUCTOR_GENERATOR(float) // UNtemplated copy constructor // (this is taken care of by the compiler itself) // explicit copy constructors (precision-loosing converters) explicit octonion(octonion const & a_recopier) { *this = detail::octonion_type_converter(a_recopier); } explicit octonion(octonion const & a_recopier) { *this = detail::octonion_type_converter(a_recopier); } // destructor // (this is taken care of by the compiler itself) // accessors // // Note: Like complex number, octonions do have a meaningful notion of "real part", // but unlike them there is no meaningful notion of "imaginary part". // Instead there is an "unreal part" which itself is an octonion, and usually // nothing simpler (as opposed to the complex number case). // However, for practicallity, there are accessors for the other components // (these are necessary for the templated copy constructor, for instance). BOOST_OCTONION_ACCESSOR_GENERATOR(float) // assignment operators BOOST_OCTONION_MEMBER_ASSIGNMENT_GENERATOR(float) // other assignment-related operators // // NOTE: Octonion multiplication is *NOT* commutative; // symbolically, "q *= rhs;" means "q = q * rhs;" // and "q /= rhs;" means "q = q * inverse_of(rhs);"; // octonion multiplication is also *NOT* associative BOOST_OCTONION_MEMBER_ALGEBRAIC_GENERATOR(float) protected: BOOST_OCTONION_MEMBER_DATA_GENERATOR(float) private: }; template<> class octonion { public: typedef double value_type; BOOST_OCTONION_CONSTRUCTOR_GENERATOR(double) // UNtemplated copy constructor // (this is taken care of by the compiler itself) // converting copy constructor explicit octonion(octonion const & a_recopier) { *this = detail::octonion_type_converter(a_recopier); } // explicit copy constructors (precision-loosing converters) explicit octonion(octonion const & a_recopier) { *this = detail::octonion_type_converter(a_recopier); } // destructor // (this is taken care of by the compiler itself) // accessors // // Note: Like complex number, octonions do have a meaningful notion of "real part", // but unlike them there is no meaningful notion of "imaginary part". // Instead there is an "unreal part" which itself is an octonion, and usually // nothing simpler (as opposed to the complex number case). // However, for practicallity, there are accessors for the other components // (these are necessary for the templated copy constructor, for instance). BOOST_OCTONION_ACCESSOR_GENERATOR(double) // assignment operators BOOST_OCTONION_MEMBER_ASSIGNMENT_GENERATOR(double) // other assignment-related operators // // NOTE: Octonion multiplication is *NOT* commutative; // symbolically, "q *= rhs;" means "q = q * rhs;" // and "q /= rhs;" means "q = q * inverse_of(rhs);"; // octonion multiplication is also *NOT* associative BOOST_OCTONION_MEMBER_ALGEBRAIC_GENERATOR(double) protected: BOOST_OCTONION_MEMBER_DATA_GENERATOR(double) private: }; template<> class octonion { public: typedef long double value_type; BOOST_OCTONION_CONSTRUCTOR_GENERATOR(long double) // UNtemplated copy constructor // (this is taken care of by the compiler itself) // converting copy constructor explicit octonion(octonion const & a_recopier) { *this = detail::octonion_type_converter(a_recopier); } explicit octonion(octonion const & a_recopier) { *this = detail::octonion_type_converter(a_recopier); } // destructor // (this is taken care of by the compiler itself) // accessors // // Note: Like complex number, octonions do have a meaningful notion of "real part", // but unlike them there is no meaningful notion of "imaginary part". // Instead there is an "unreal part" which itself is an octonion, and usually // nothing simpler (as opposed to the complex number case). // However, for practicallity, there are accessors for the other components // (these are necessary for the templated copy constructor, for instance). BOOST_OCTONION_ACCESSOR_GENERATOR(long double) // assignment operators BOOST_OCTONION_MEMBER_ASSIGNMENT_GENERATOR(long double) // other assignment-related operators // // NOTE: Octonion multiplication is *NOT* commutative; // symbolically, "q *= rhs;" means "q = q * rhs;" // and "q /= rhs;" means "q = q * inverse_of(rhs);"; // octonion multiplication is also *NOT* associative BOOST_OCTONION_MEMBER_ALGEBRAIC_GENERATOR(long double) protected: BOOST_OCTONION_MEMBER_DATA_GENERATOR(long double) private: }; #undef BOOST_OCTONION_CONSTRUCTOR_GENERATOR #undef BOOST_OCTONION_MEMBER_ALGEBRAIC_GENERATOR #undef BOOST_OCTONION_MEMBER_ADD_GENERATOR #undef BOOST_OCTONION_MEMBER_SUB_GENERATOR #undef BOOST_OCTONION_MEMBER_MUL_GENERATOR #undef BOOST_OCTONION_MEMBER_DIV_GENERATOR #undef BOOST_OCTONION_MEMBER_ADD_GENERATOR_1 #undef BOOST_OCTONION_MEMBER_ADD_GENERATOR_2 #undef BOOST_OCTONION_MEMBER_ADD_GENERATOR_3 #undef BOOST_OCTONION_MEMBER_ADD_GENERATOR_4 #undef BOOST_OCTONION_MEMBER_SUB_GENERATOR_1 #undef BOOST_OCTONION_MEMBER_SUB_GENERATOR_2 #undef BOOST_OCTONION_MEMBER_SUB_GENERATOR_3 #undef BOOST_OCTONION_MEMBER_SUB_GENERATOR_4 #undef BOOST_OCTONION_MEMBER_MUL_GENERATOR_1 #undef BOOST_OCTONION_MEMBER_MUL_GENERATOR_2 #undef BOOST_OCTONION_MEMBER_MUL_GENERATOR_3 #undef BOOST_OCTONION_MEMBER_MUL_GENERATOR_4 #undef BOOST_OCTONION_MEMBER_DIV_GENERATOR_1 #undef BOOST_OCTONION_MEMBER_DIV_GENERATOR_2 #undef BOOST_OCTONION_MEMBER_DIV_GENERATOR_3 #undef BOOST_OCTONION_MEMBER_DIV_GENERATOR_4 #undef BOOST_OCTONION_MEMBER_DATA_GENERATOR #undef BOOST_OCTONION_MEMBER_ASSIGNMENT_GENERATOR #undef BOOST_OCTONION_ACCESSOR_GENERATOR // operators #define BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) \ { \ octonion res(lhs); \ res op##= rhs; \ return(res); \ } #define BOOST_OCTONION_OPERATOR_GENERATOR_1_L(op) \ template \ inline octonion operator op (T const & lhs, octonion const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR_1_R(op) \ template \ inline octonion operator op (octonion const & lhs, T const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR_2_L(op) \ template \ inline octonion operator op (::std::complex const & lhs, octonion const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR_2_R(op) \ template \ inline octonion operator op (octonion const & lhs, ::std::complex const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR_3_L(op) \ template \ inline octonion operator op (::boost::math::quaternion const & lhs, octonion const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR_3_R(op) \ template \ inline octonion operator op (octonion const & lhs, ::boost::math::quaternion const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR_4(op) \ template \ inline octonion operator op (octonion const & lhs, octonion const & rhs) \ BOOST_OCTONION_OPERATOR_GENERATOR_BODY(op) #define BOOST_OCTONION_OPERATOR_GENERATOR(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_1_L(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_1_R(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_2_L(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_2_R(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_3_L(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_3_R(op) \ BOOST_OCTONION_OPERATOR_GENERATOR_4(op) BOOST_OCTONION_OPERATOR_GENERATOR(+) BOOST_OCTONION_OPERATOR_GENERATOR(-) BOOST_OCTONION_OPERATOR_GENERATOR(*) BOOST_OCTONION_OPERATOR_GENERATOR(/) #undef BOOST_OCTONION_OPERATOR_GENERATOR #undef BOOST_OCTONION_OPERATOR_GENERATOR_1_L #undef BOOST_OCTONION_OPERATOR_GENERATOR_1_R #undef BOOST_OCTONION_OPERATOR_GENERATOR_2_L #undef BOOST_OCTONION_OPERATOR_GENERATOR_2_R #undef BOOST_OCTONION_OPERATOR_GENERATOR_3_L #undef BOOST_OCTONION_OPERATOR_GENERATOR_3_R #undef BOOST_OCTONION_OPERATOR_GENERATOR_4 #undef BOOST_OCTONION_OPERATOR_GENERATOR_BODY template inline octonion operator + (octonion const & o) { return(o); } template inline octonion operator - (octonion const & o) { return(octonion(-o.R_component_1(),-o.R_component_2(),-o.R_component_3(),-o.R_component_4(),-o.R_component_5(),-o.R_component_6(),-o.R_component_7(),-o.R_component_8())); } template inline bool operator == (T const & lhs, octonion const & rhs) { return( (rhs.R_component_1() == lhs)&& (rhs.R_component_2() == static_cast(0))&& (rhs.R_component_3() == static_cast(0))&& (rhs.R_component_4() == static_cast(0))&& (rhs.R_component_5() == static_cast(0))&& (rhs.R_component_6() == static_cast(0))&& (rhs.R_component_7() == static_cast(0))&& (rhs.R_component_8() == static_cast(0)) ); } template inline bool operator == (octonion const & lhs, T const & rhs) { return( (lhs.R_component_1() == rhs)&& (lhs.R_component_2() == static_cast(0))&& (lhs.R_component_3() == static_cast(0))&& (lhs.R_component_4() == static_cast(0))&& (lhs.R_component_5() == static_cast(0))&& (lhs.R_component_6() == static_cast(0))&& (lhs.R_component_7() == static_cast(0))&& (lhs.R_component_8() == static_cast(0)) ); } template inline bool operator == (::std::complex const & lhs, octonion const & rhs) { return( (rhs.R_component_1() == lhs.real())&& (rhs.R_component_2() == lhs.imag())&& (rhs.R_component_3() == static_cast(0))&& (rhs.R_component_4() == static_cast(0))&& (rhs.R_component_5() == static_cast(0))&& (rhs.R_component_6() == static_cast(0))&& (rhs.R_component_7() == static_cast(0))&& (rhs.R_component_8() == static_cast(0)) ); } template inline bool operator == (octonion const & lhs, ::std::complex const & rhs) { return( (lhs.R_component_1() == rhs.real())&& (lhs.R_component_2() == rhs.imag())&& (lhs.R_component_3() == static_cast(0))&& (lhs.R_component_4() == static_cast(0))&& (lhs.R_component_5() == static_cast(0))&& (lhs.R_component_6() == static_cast(0))&& (lhs.R_component_7() == static_cast(0))&& (lhs.R_component_8() == static_cast(0)) ); } template inline bool operator == (::boost::math::quaternion const & lhs, octonion const & rhs) { return( (rhs.R_component_1() == lhs.R_component_1())&& (rhs.R_component_2() == lhs.R_component_2())&& (rhs.R_component_3() == lhs.R_component_3())&& (rhs.R_component_4() == lhs.R_component_4())&& (rhs.R_component_5() == static_cast(0))&& (rhs.R_component_6() == static_cast(0))&& (rhs.R_component_7() == static_cast(0))&& (rhs.R_component_8() == static_cast(0)) ); } template inline bool operator == (octonion const & lhs, ::boost::math::quaternion const & rhs) { return( (lhs.R_component_1() == rhs.R_component_1())&& (lhs.R_component_2() == rhs.R_component_2())&& (lhs.R_component_3() == rhs.R_component_3())&& (lhs.R_component_4() == rhs.R_component_4())&& (lhs.R_component_5() == static_cast(0))&& (lhs.R_component_6() == static_cast(0))&& (lhs.R_component_7() == static_cast(0))&& (lhs.R_component_8() == static_cast(0)) ); } template inline bool operator == (octonion const & lhs, octonion const & rhs) { return( (rhs.R_component_1() == lhs.R_component_1())&& (rhs.R_component_2() == lhs.R_component_2())&& (rhs.R_component_3() == lhs.R_component_3())&& (rhs.R_component_4() == lhs.R_component_4())&& (rhs.R_component_5() == lhs.R_component_5())&& (rhs.R_component_6() == lhs.R_component_6())&& (rhs.R_component_7() == lhs.R_component_7())&& (rhs.R_component_8() == lhs.R_component_8()) ); } #define BOOST_OCTONION_NOT_EQUAL_GENERATOR \ { \ return(!(lhs == rhs)); \ } template inline bool operator != (T const & lhs, octonion const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR template inline bool operator != (octonion const & lhs, T const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR template inline bool operator != (::std::complex const & lhs, octonion const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR template inline bool operator != (octonion const & lhs, ::std::complex const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR template inline bool operator != (::boost::math::quaternion const & lhs, octonion const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR template inline bool operator != (octonion const & lhs, ::boost::math::quaternion const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR template inline bool operator != (octonion const & lhs, octonion const & rhs) BOOST_OCTONION_NOT_EQUAL_GENERATOR #undef BOOST_OCTONION_NOT_EQUAL_GENERATOR // Note: the default values in the constructors of the complex and quaternions make for // a very complex and ambiguous situation; we have made choices to disambiguate. template ::std::basic_istream & operator >> ( ::std::basic_istream & is, octonion & o) { #ifdef BOOST_NO_STD_LOCALE #else const ::std::ctype & ct = ::std::use_facet< ::std::ctype >(is.getloc()); #endif /* BOOST_NO_STD_LOCALE */ T a = T(); T b = T(); T c = T(); T d = T(); T e = T(); T f = T(); T g = T(); T h = T(); ::std::complex u = ::std::complex(); ::std::complex v = ::std::complex(); ::std::complex x = ::std::complex(); ::std::complex y = ::std::complex(); ::boost::math::quaternion p = ::boost::math::quaternion(); ::boost::math::quaternion q = ::boost::math::quaternion(); charT ch = charT(); char cc; is >> ch; // get the first lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(" { is >> ch; // get the second lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((" { is >> ch; // get the third lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(((" { is.putback(ch); is >> u; // read "((u" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((u)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // format: (((a))), (((a,b))) { o = octonion(u); } else if (cc == ',') // read "((u)," { p = ::boost::math::quaternion(u); is >> q; // read "((u),q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // format: (((a)),q), (((a,b)),q) { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc ==',') // read "((u," { is >> v; // read "((u,v" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((u,v)" { p = ::boost::math::quaternion(u,v); is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // format: (((a),v)), (((a,b),v)) { o = octonion(p); } else if (cc == ',') // read "((u,v)," { is >> q; // read "(p,q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // format: (((a),v),q), (((a,b),v),q) { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // read "((a" { is.putback(ch); is >> a; // we extract the first component if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a))" { o = octonion(a); } else if (cc == ',') // read "((a)," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a),(" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a),((" { is.putback(ch); is.putback(ch); // we backtrack twice, with the same value! is >> q; // read "((a),q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),q)" { p = ::boost::math::quaternion(a); o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // read "((a),(c" or "((a),(e" { is.putback(ch); is >> c; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c)" (ambiguity resolution) { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c))" { o = octonion(a,b,c); } else if (cc == ',') // read "((a),(c)," { u = ::std::complex(a); v = ::std::complex(c); is >> x; // read "((a),(c),x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c),x)" { o = octonion(u,v,x); } else if (cc == ',') // read "((a),(c),x," { is >> y; // read "((a),(c),x,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c),x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a),(c," or "((a),(e," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a),(e,(" (ambiguity resolution) { p = ::boost::math::quaternion(a); x = ::std::complex(c); // "c" was actually "e" is.putback(ch); // we can only backtrace once is >> y; // read "((a),(e,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(e,y)" { q = ::boost::math::quaternion(x,y); is >> ch; // get the next lexeme #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(e,y))" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // read "((a),(c,d" or "((a),(e,f" { is.putback(ch); is >> d; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c,d)" (ambiguity resolution) { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c,d))" { o = octonion(a,b,c,d); } else if (cc == ',') // read "((a),(c,d)," { u = ::std::complex(a); v = ::std::complex(c,d); is >> x; // read "((a),(c,d),x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c,d),x)" { o = octonion(u,v,x); } else if (cc == ',') // read "((a),(c,d),x," { is >> y; // read "((a),(c,d),x,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(c,d),x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a),(e,f," (ambiguity resolution) { p = ::boost::math::quaternion(a); is >> g; // read "((a),(e,f,g" (too late to backtrack) if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(e,f,g)" { q = ::boost::math::quaternion(c,d,g); // "c" was actually "e", and "d" was actually "f" is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(e,f,g))" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a),(e,f,g," { is >> h; // read "((a),(e,f,g,h" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(e,f,g,h)" { q = ::boost::math::quaternion(c,d,g,h); // "c" was actually "e", and "d" was actually "f" is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),(e,f,g,h))" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // read "((a),c" (ambiguity resolution) { is.putback(ch); is >> c; // we extract the third component if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),c)" { o = octonion(a,b,c); } else if (cc == ',') // read "((a),c," { is >> x; // read "((a),c,x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),c,x)" { o = octonion(a,b,c,d,x.real(),x.imag()); } else if (cc == ',') // read "((a),c,x," { is >> y;if (!is.good()) goto finish; // read "((a),c,x,y" is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a),c,x,y)" { o = octonion(a,b,c,d,x.real(),x.imag(),y.real(),y.imag()); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc ==',') // read "((a," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a,(" { u = ::std::complex(a); is.putback(ch); // can only backtrack so much is >> v; // read "((a,v" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,v)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,v))" { o = octonion(u,v); } else if (cc == ',') // read "((a,v)," { p = ::boost::math::quaternion(u,v); is >> q; // read "((a,v),q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,v),q)" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else { is.putback(ch); is >> b; // read "((a,b" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b))" { o = octonion(a,b); } else if (cc == ',') // read "((a,b)," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a,b),(" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a,b),((" { p = ::boost::math::quaternion(a,b); is.putback(ch); is.putback(ch); // we backtrack twice, with the same value is >> q; // read "((a,b),q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),q)" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // read "((a,b),(c" or "((a,b),(e" { is.putback(ch); is >> c; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c)" (ambiguity resolution) { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c))" { o = octonion(a,b,c); } else if (cc == ',') // read "((a,b),(c)," { u = ::std::complex(a,b); v = ::std::complex(c); is >> x; // read "((a,b),(c),x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c),x)" { o = octonion(u,v,x); } else if (cc == ',') // read "((a,b),(c),x," { is >> y; // read "((a,b),(c),x,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c),x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a,b),(c," or "((a,b),(e," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "((a,b),(e,(" (ambiguity resolution) { u = ::std::complex(a,b); x = ::std::complex(c); // "c" is actually "e" is.putback(ch); is >> y; // read "((a,b),(e,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(e,y)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(e,y))" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // read "((a,b),(c,d" or "((a,b),(e,f" { is.putback(ch); is >> d; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c,d)" (ambiguity resolution) { u = ::std::complex(a,b); v = ::std::complex(c,d); is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c,d))" { o = octonion(u,v); } else if (cc == ',') // read "((a,b),(c,d)," { is >> x; // read "((a,b),(c,d),x if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c,d),x)" { o = octonion(u,v,x); } else if (cc == ',') // read "((a,b),(c,d),x," { is >> y; // read "((a,b),(c,d),x,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(c,d),x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a,b),(e,f," (ambiguity resolution) { p = ::boost::math::quaternion(a,b); // too late to backtrack is >> g; // read "((a,b),(e,f,g" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(e,f,g)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(e,f,g))" { q = ::boost::math::quaternion(c,d,g); // "c" is actually "e" and "d" is actually "f" o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a,b),(e,f,g," { is >> h; // read "((a,b),(e,f,g,h" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b),(e,f,g,h)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read ((a,b),(e,f,g,h))" { q = ::boost::math::quaternion(c,d,g,h); // "c" is actually "e" and "d" is actually "f" o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a,b," { is >> c; // read "((a,b,c" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b,c)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b,c))" { o = octonion(a,b,c); } else if (cc == ',') // read "((a,b,c)," { p = ::boost::math::quaternion(a,b,c); is >> q; // read "((a,b,c),q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b,c),q)" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "((a,b,c," { is >> d; // read "((a,b,c,d" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b,c,d)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b,c,d))" { o = octonion(a,b,c,d); } else if (cc == ',') // read "((a,b,c,d)," { p = ::boost::math::quaternion(a,b,c,d); is >> q; // read "((a,b,c,d),q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "((a,b,c,d),q)" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // read "(a" { is.putback(ch); is >> a; // we extract the first component if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a)" { o = octonion(a); } else if (cc == ',') // read "(a," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(a,(" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(a,((" { p = ::boost::math::quaternion(a); is.putback(ch); is.putback(ch); // we backtrack twice, with the same value is >> q; // read "(a,q" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,q)" { o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // read "(a,(c" or "(a,(e" { is.putback(ch); is >> c; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c)" (ambiguity resolution) { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c))" { o = octonion(a,b,c); } else if (cc == ',') // read "(a,(c)," { u = ::std::complex(a); v = ::std::complex(c); is >> x; // read "(a,(c),x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c),x)" { o = octonion(u,v,x); } else if (cc == ',') // read "(a,(c),x," { is >> y; // read "(a,(c),x,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c),x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "(a,(c," or "(a,(e," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(a,(e,(" (ambiguity resolution) { u = ::std::complex(a); x = ::std::complex(c); // "c" is actually "e" is.putback(ch); // we backtrack is >> y; // read "(a,(e,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(e,y)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(e,y))" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // read "(a,(c,d" or "(a,(e,f" { is.putback(ch); is >> d; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c,d)" (ambiguity resolution) { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c,d))" { o = octonion(a,b,c,d); } else if (cc == ',') // read "(a,(c,d)," { u = ::std::complex(a); v = ::std::complex(c,d); is >> x; // read "(a,(c,d),x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c,d),x)" { o = octonion(u,v,x); } else if (cc == ',') // read "(a,(c,d),x," { is >> y; // read "(a,(c,d),x,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(c,d),x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "(a,(e,f," (ambiguity resolution) { p = ::boost::math::quaternion(a); is >> g; // read "(a,(e,f,g" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(e,f,g)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(e,f,g))" { q = ::boost::math::quaternion(c,d,g); // "c" is actually "e" and "d" is actually "f" o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else if (cc == ',') // read "(a,(e,f,g," { is >> h; // read "(a,(e,f,g,h" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(e,f,g,h)" { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,(e,f,g,h))" { q = ::boost::math::quaternion(c,d,g,h); // "c" is actually "e" and "d" is actually "f" o = octonion(p,q); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // read "(a,b" or "(a,c" (ambiguity resolution) { is.putback(ch); is >> b; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b)" (ambiguity resolution) { o = octonion(a,b); } else if (cc == ',') // read "(a,b," or "(a,c," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(a,c,(" (ambiguity resolution) { u = ::std::complex(a); v = ::std::complex(b); // "b" is actually "c" is.putback(ch); // we backtrack is >> x; // read "(a,c,x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,c,x)" { o = octonion(u,v,x); } else if (cc == ',') // read "(a,c,x," { is >> y; // read "(a,c,x,y" // read "(a,c,x" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,c,x,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // read "(a,b,c" or "(a,c,e" { is.putback(ch); is >> c; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b,c)" (ambiguity resolution) { o = octonion(a,b,c); } else if (cc == ',') // read "(a,b,c," or "(a,c,e," { is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == '(') // read "(a,c,e,(") (ambiguity resolution) { u = ::std::complex(a); v = ::std::complex(b); // "b" is actually "c" x = ::std::complex(c); // "c" is actually "e" is.putback(ch); // we backtrack is >> y; // read "(a,c,e,y" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,c,e,y)" { o = octonion(u,v,x,y); } else // error { is.setstate(::std::ios_base::failbit); } } else // read "(a,b,c,d" (ambiguity resolution) { is.putback(ch); // we backtrack is >> d; if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b,c,d)" { o = octonion(a,b,c,d); } else if (cc == ',') // read "(a,b,c,d," { is >> e; // read "(a,b,c,d,e" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b,c,d,e)" { o = octonion(a,b,c,d,e); } else if (cc == ',') // read "(a,b,c,d,e," { is >> f; // read "(a,b,c,d,e,f" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b,c,d,e,f)" { o = octonion(a,b,c,d,e,f); } else if (cc == ',') // read "(a,b,c,d,e,f," { is >> g; // read "(a,b,c,d,e,f,g" // read "(a,b,c,d,e,f" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b,c,d,e,f,g)" { o = octonion(a,b,c,d,e,f,g); } else if (cc == ',') // read "(a,b,c,d,e,f,g," { is >> h; // read "(a,b,c,d,e,f,g,h" // read "(a,b,c,d,e,f,g" // read "(a,b,c,d,e,f" if (!is.good()) goto finish; is >> ch; // get the next lexeme if (!is.good()) goto finish; #ifdef BOOST_NO_STD_LOCALE cc = ch; #else cc = ct.narrow(ch, char()); #endif /* BOOST_NO_STD_LOCALE */ if (cc == ')') // read "(a,b,c,d,e,f,g,h)" { o = octonion(a,b,c,d,e,f,g,h); } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // error { is.setstate(::std::ios_base::failbit); } } } else // format: a { is.putback(ch); is >> a; // we extract the first component if (!is.good()) goto finish; o = octonion(a); } finish: return(is); } template ::std::basic_ostream & operator << ( ::std::basic_ostream & os, octonion const & o) { ::std::basic_ostringstream s; s.flags(os.flags()); #ifdef BOOST_NO_STD_LOCALE #else s.imbue(os.getloc()); #endif /* BOOST_NO_STD_LOCALE */ s.precision(os.precision()); s << '(' << o.R_component_1() << ',' << o.R_component_2() << ',' << o.R_component_3() << ',' << o.R_component_4() << ',' << o.R_component_5() << ',' << o.R_component_6() << ',' << o.R_component_7() << ',' << o.R_component_8() << ')'; return os << s.str(); } // values template inline T real(octonion const & o) { return(o.real()); } template inline octonion unreal(octonion const & o) { return(o.unreal()); } #define BOOST_OCTONION_VALARRAY_LOADER \ using ::std::valarray; \ \ valarray temp(8); \ \ temp[0] = o.R_component_1(); \ temp[1] = o.R_component_2(); \ temp[2] = o.R_component_3(); \ temp[3] = o.R_component_4(); \ temp[4] = o.R_component_5(); \ temp[5] = o.R_component_6(); \ temp[6] = o.R_component_7(); \ temp[7] = o.R_component_8(); template inline T sup(octonion const & o) { #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP using ::std::abs; #endif /* BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP */ BOOST_OCTONION_VALARRAY_LOADER return((abs(temp).max)()); } template inline T l1(octonion const & o) { #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP using ::std::abs; #endif /* BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP */ BOOST_OCTONION_VALARRAY_LOADER return(abs(temp).sum()); } template inline T abs(const octonion & o) { #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP using ::std::abs; #endif /* BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP */ using ::std::sqrt; BOOST_OCTONION_VALARRAY_LOADER T maxim = (abs(temp).max)(); // overflow protection if (maxim == static_cast(0)) { return(maxim); } else { T mixam = static_cast(1)/maxim; // prefer multiplications over divisions temp *= mixam; temp *= temp; return(maxim*sqrt(temp.sum())); } //return(::std::sqrt(norm(o))); } #undef BOOST_OCTONION_VALARRAY_LOADER // Note: This is the Cayley norm, not the Euclidian norm... template inline T norm(octonion const & o) { return(real(o*conj(o))); } template inline octonion conj(octonion const & o) { return(octonion( +o.R_component_1(), -o.R_component_2(), -o.R_component_3(), -o.R_component_4(), -o.R_component_5(), -o.R_component_6(), -o.R_component_7(), -o.R_component_8())); } // Note: There is little point, for the octonions, to introduce the equivalents // to the complex "arg" and the quaternionic "cylindropolar". template inline octonion spherical(T const & rho, T const & theta, T const & phi1, T const & phi2, T const & phi3, T const & phi4, T const & phi5, T const & phi6) { using ::std::cos; using ::std::sin; //T a = cos(theta)*cos(phi1)*cos(phi2)*cos(phi3)*cos(phi4)*cos(phi5)*cos(phi6); //T b = sin(theta)*cos(phi1)*cos(phi2)*cos(phi3)*cos(phi4)*cos(phi5)*cos(phi6); //T c = sin(phi1)*cos(phi2)*cos(phi3)*cos(phi4)*cos(phi5)*cos(phi6); //T d = sin(phi2)*cos(phi3)*cos(phi4)*cos(phi5)*cos(phi6); //T e = sin(phi3)*cos(phi4)*cos(phi5)*cos(phi6); //T f = sin(phi4)*cos(phi5)*cos(phi6); //T g = sin(phi5)*cos(phi6); //T h = sin(phi6); T courrant = static_cast(1); T h = sin(phi6); courrant *= cos(phi6); T g = sin(phi5)*courrant; courrant *= cos(phi5); T f = sin(phi4)*courrant; courrant *= cos(phi4); T e = sin(phi3)*courrant; courrant *= cos(phi3); T d = sin(phi2)*courrant; courrant *= cos(phi2); T c = sin(phi1)*courrant; courrant *= cos(phi1); T b = sin(theta)*courrant; T a = cos(theta)*courrant; return(rho*octonion(a,b,c,d,e,f,g,h)); } template inline octonion multipolar(T const & rho1, T const & theta1, T const & rho2, T const & theta2, T const & rho3, T const & theta3, T const & rho4, T const & theta4) { using ::std::cos; using ::std::sin; T a = rho1*cos(theta1); T b = rho1*sin(theta1); T c = rho2*cos(theta2); T d = rho2*sin(theta2); T e = rho3*cos(theta3); T f = rho3*sin(theta3); T g = rho4*cos(theta4); T h = rho4*sin(theta4); return(octonion(a,b,c,d,e,f,g,h)); } template inline octonion cylindrical(T const & r, T const & angle, T const & h1, T const & h2, T const & h3, T const & h4, T const & h5, T const & h6) { using ::std::cos; using ::std::sin; T a = r*cos(angle); T b = r*sin(angle); return(octonion(a,b,h1,h2,h3,h4,h5,h6)); } template inline octonion exp(octonion const & o) { using ::std::exp; using ::std::cos; using ::boost::math::sinc_pi; T u = exp(real(o)); T z = abs(unreal(o)); T w = sinc_pi(z); return(u*octonion(cos(z), w*o.R_component_2(), w*o.R_component_3(), w*o.R_component_4(), w*o.R_component_5(), w*o.R_component_6(), w*o.R_component_7(), w*o.R_component_8())); } template inline octonion cos(octonion const & o) { using ::std::sin; using ::std::cos; using ::std::cosh; using ::boost::math::sinhc_pi; T z = abs(unreal(o)); T w = -sin(o.real())*sinhc_pi(z); return(octonion(cos(o.real())*cosh(z), w*o.R_component_2(), w*o.R_component_3(), w*o.R_component_4(), w*o.R_component_5(), w*o.R_component_6(), w*o.R_component_7(), w*o.R_component_8())); } template inline octonion sin(octonion const & o) { using ::std::sin; using ::std::cos; using ::std::cosh; using ::boost::math::sinhc_pi; T z = abs(unreal(o)); T w = +cos(o.real())*sinhc_pi(z); return(octonion(sin(o.real())*cosh(z), w*o.R_component_2(), w*o.R_component_3(), w*o.R_component_4(), w*o.R_component_5(), w*o.R_component_6(), w*o.R_component_7(), w*o.R_component_8())); } template inline octonion tan(octonion const & o) { return(sin(o)/cos(o)); } template inline octonion cosh(octonion const & o) { return((exp(+o)+exp(-o))/static_cast(2)); } template inline octonion sinh(octonion const & o) { return((exp(+o)-exp(-o))/static_cast(2)); } template inline octonion tanh(octonion const & o) { return(sinh(o)/cosh(o)); } template octonion pow(octonion const & o, int n) { if (n > 1) { int m = n>>1; octonion result = pow(o, m); result *= result; if (n != (m<<1)) { result *= o; // n odd } return(result); } else if (n == 1) { return(o); } else if (n == 0) { return(octonion(static_cast(1))); } else /* n < 0 */ { return(pow(octonion(static_cast(1))/o,-n)); } } // helper templates for converting copy constructors (definition) namespace detail { template< typename T, typename U > octonion octonion_type_converter(octonion const & rhs) { return(octonion( static_cast(rhs.R_component_1()), static_cast(rhs.R_component_2()), static_cast(rhs.R_component_3()), static_cast(rhs.R_component_4()), static_cast(rhs.R_component_5()), static_cast(rhs.R_component_6()), static_cast(rhs.R_component_7()), static_cast(rhs.R_component_8()))); } } } } #endif /* BOOST_OCTONION_HPP */ cpplint-1.5.5/samples/boost-sample/simple.def000066400000000000000000011145521405143476300212350ustar00rootroot00000000000000include/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] cpplint-1.5.5/samples/boost-sample/src/000077500000000000000000000000001405143476300200425ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/src/inspect/000077500000000000000000000000001405143476300215075ustar00rootroot00000000000000cpplint-1.5.5/samples/boost-sample/src/inspect/unnamed_namespace_check.hpp000066400000000000000000000031341405143476300270210ustar00rootroot00000000000000// unnamed_namespace_check -----------------------------------------// // Copyright Gennaro Prota 2006. // // Distributed under 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 "boost/regex.hpp" #include "boost/lexical_cast.hpp" #include "unnamed_namespace_check.hpp" namespace { boost::regex unnamed_namespace_regex( "\\ #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) } cpplint-1.5.5/samples/chromium-sample/000077500000000000000000000000001405143476300177505ustar00rootroot00000000000000cpplint-1.5.5/samples/chromium-sample/README.md000066400000000000000000000001321405143476300212230ustar00rootroot00000000000000# VLC sample code taken for regression testing from https://github.com/chromium/chromium cpplint-1.5.5/samples/chromium-sample/simple.def000066400000000000000000000036311405143476300217240ustar00rootroot00000000000000src/* 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] cpplint-1.5.5/samples/chromium-sample/src/000077500000000000000000000000001405143476300205375ustar00rootroot00000000000000cpplint-1.5.5/samples/chromium-sample/src/chrome_content_renderer_client.cc000066400000000000000000001546051405143476300273140ustar00rootroot00000000000000// 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 } cpplint-1.5.5/samples/chromium-sample/src/chrome_content_renderer_client.h000066400000000000000000000206201405143476300271430ustar00rootroot00000000000000// 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_ cpplint-1.5.5/samples/chromium-sample/src/io_thread.cc000066400000000000000000002066251405143476300230170ustar00rootroot00000000000000// 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_; } cpplint-1.5.5/samples/chromium-sample/src/io_thread.h000066400000000000000000000534651405143476300226630ustar00rootroot00000000000000// 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_ cpplint-1.5.5/samples/codelite-sample/000077500000000000000000000000001405143476300177155ustar00rootroot00000000000000cpplint-1.5.5/samples/codelite-sample/LICENSE000066400000000000000000000435721405143476300207350ustar00rootroot00000000000000 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 cpplint-1.5.5/samples/codelite-sample/README.md000066400000000000000000000001701405143476300211720ustar00rootroot00000000000000Canary sample taken from codelite https://github.com/eranif/codelite License applies as per LICENSE file in this folder cpplint-1.5.5/samples/codelite-sample/simple.def000066400000000000000000001534141405143476300216760ustar00rootroot00000000000000src/* 1 4 Done processing src/pptable.cpp Done processing src/pptable.h Total errors found: 681 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:341: Using C-style cast. Use static_cast(...) instead [readability/casting] [4] 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] cpplint-1.5.5/samples/codelite-sample/src/000077500000000000000000000000001405143476300205045ustar00rootroot00000000000000cpplint-1.5.5/samples/codelite-sample/src/pptable.cpp000066400000000000000000000362211405143476300226430ustar00rootroot00000000000000#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 cpplint-1.5.5/samples/protobuf-sample/000077500000000000000000000000001405143476300177655ustar00rootroot00000000000000cpplint-1.5.5/samples/protobuf-sample/LICENSE000066400000000000000000000033051405143476300207730ustar00rootroot00000000000000Copyright 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. cpplint-1.5.5/samples/protobuf-sample/README.md000066400000000000000000000001411405143476300212400ustar00rootroot00000000000000# VLC sample code taken for regression testing from https://github.com/protocolbuffers/protobuf cpplint-1.5.5/samples/protobuf-sample/simple.def000066400000000000000000010134621405143476300217450ustar00rootroot00000000000000src/* 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] cpplint-1.5.5/samples/protobuf-sample/src/000077500000000000000000000000001405143476300205545ustar00rootroot00000000000000cpplint-1.5.5/samples/protobuf-sample/src/descriptor.pb.cc000066400000000000000000022041341405143476300236470ustar00rootroot00000000000000// 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) cpplint-1.5.5/samples/protobuf-sample/src/descriptor.pb.h000066400000000000000000011600671405143476300235160ustar00rootroot00000000000000// 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 cpplint-1.5.5/samples/protobuf-sample/src/descriptor_unittest.cc000066400000000000000000007257321405143476300252200ustar00rootroot00000000000000// 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 cpplint-1.5.5/samples/silly-sample/000077500000000000000000000000001405143476300172615ustar00rootroot00000000000000cpplint-1.5.5/samples/silly-sample/filters.def000066400000000000000000000047601405143476300214200ustar00rootroot00000000000000--counting=toplevel --filter=-whitespace,-build/include_what_you_use src/*.cpp 1 7 Done processing src/sillycode.cpp Category 'build' errors found: 1 Category 'legal' errors found: 1 Category 'readability' errors found: 5 Category 'runtime' errors found: 12 Total errors found: 19 src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] src/sillycode.cpp:3: Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector& v [runtime/references] [2] src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4] src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [5] 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:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] src/sillycode.cpp:171: 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:178: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:199: If an else has a brace on one side, it should have it on both [readability/braces] [5] src/sillycode.cpp:202: If an else has a brace on one side, it should have it on both [readability/braces] [5] src/sillycode.cpp:208: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:227: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:228: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] src/sillycode.cpp:243: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] cpplint-1.5.5/samples/silly-sample/includeorder_cfirst.def000066400000000000000000000241711405143476300237770ustar00rootroot00000000000000--includeorder=standardcfirst 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:8: public: should be indented +1 space inside class Date [whitespace/indent] [3] src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector& v [runtime/references] [2] src/sillycode.cpp:15: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:39: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:40: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4] src/sillycode.cpp:49: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:49: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:55: { should almost always be at the end of the previous line [whitespace/braces] [4] 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:64: public: should be indented +1 space inside class X [whitespace/indent] [3] src/sillycode.cpp:65: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:65: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:66: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:74: public: should be indented +1 space inside class X2 [whitespace/indent] [3] src/sillycode.cpp:75: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:76: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:80: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:80: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:84: public: should be indented +1 space inside class X3 [whitespace/indent] [3] src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:86: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:86: Lines should be <= 80 characters long [whitespace/line_length] [2] src/sillycode.cpp:94: public: should be indented +1 space inside class Foo [whitespace/indent] [3] src/sillycode.cpp:100: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:110: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:111: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:111: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:113: public: should be indented +1 space inside class Vector2 [whitespace/indent] [3] 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: Missing space after , [whitespace/comma] [3] src/sillycode.cpp:122: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/sillycode.cpp:122: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] src/sillycode.cpp:124: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:125: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:125: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:126: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:126: Missing space after , [whitespace/comma] [3] src/sillycode.cpp:143: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:144: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:149: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:150: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:155: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:156: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:162: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:164: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:166: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:168: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:171: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:171: 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:175: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:178: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:178: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:178: Static/global string variables are not permitted. [runtime/string] [4] 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:184: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:184: 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:195: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:195: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:197: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:197: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:199: If an else has a brace on one side, it should have it on both [readability/braces] [5] src/sillycode.cpp:202: An else should appear on the same line as the preceding } [whitespace/newline] [4] src/sillycode.cpp:202: If an else has a brace on one side, it should have it on both [readability/braces] [5] src/sillycode.cpp:208: Missing space before { [whitespace/braces] [5] src/sillycode.cpp:208: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:209: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:209: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:214: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:217: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:218: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:218: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:219: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:219: 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:225: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:225: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:227: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:228: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:228: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] src/sillycode.cpp:236: public: should be indented +1 space inside class derived2 [whitespace/indent] [3] src/sillycode.cpp:241: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:243: Lines should be <= 80 characters long [whitespace/line_length] [2] src/sillycode.cpp:243: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:243: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] src/sillycode.cpp:244: Lines should be <= 80 characters long [whitespace/line_length] [2] src/sillycode.cpp:244: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:253: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:254: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:257: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:257: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:260: Empty loop bodies should use {} or continue [whitespace/empty_loop_body] [5] src/sillycode.cpp:260: At least two spaces is best between code and comments [whitespace/comments] [2] cpplint-1.5.5/samples/silly-sample/sed.def000066400000000000000000000253001405143476300205140ustar00rootroot00000000000000--output=sed src/*.cpp 1 5 sed -i '120s/,\([^ ]\)/, \1/g' src/sillycode.cpp # Missing space after , [whitespace/comma] [3] sed -i '122s/\s*$//' src/sillycode.cpp # Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] sed -i '126s/,\([^ ]\)/, \1/g' src/sillycode.cpp # Missing space after , [whitespace/comma] [3] sed -i '208s/\([^ ]\){/\1 {/' src/sillycode.cpp # Missing space before { [whitespace/braces] [5] # src/sillycode.cpp:0: "No copyright message found. You should have a line: "Copyright [year] "" [legal/copyright] [5] # src/sillycode.cpp:3: "Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other." [build/include_order] [4] # src/sillycode.cpp:8: "public: should be indented +1 space inside class Date" [whitespace/indent] [3] # src/sillycode.cpp:14: "Is this a non-const reference? If so, make const or use a pointer: vector& v" [runtime/references] [2] # src/sillycode.cpp:15: "{ should almost always be at the end of the previous line" [whitespace/braces] [4] # src/sillycode.cpp:39: "{ should almost always be at the end of the previous line" [whitespace/braces] [4] # src/sillycode.cpp:40: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:40: "If/else bodies with multiple statements require braces" [readability/braces] [4] # src/sillycode.cpp:49: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:49: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:55: "{ should almost always be at the end of the previous line" [whitespace/braces] [4] # 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:64: "public: should be indented +1 space inside class X" [whitespace/indent] [3] # src/sillycode.cpp:65: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:65: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:66: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:66: "Single-parameter constructors should be marked explicit." [runtime/explicit] [5] # src/sillycode.cpp:74: "public: should be indented +1 space inside class X2" [whitespace/indent] [3] # src/sillycode.cpp:75: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:76: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:76: "Single-parameter constructors should be marked explicit." [runtime/explicit] [5] # src/sillycode.cpp:80: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:80: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:84: "public: should be indented +1 space inside class X3" [whitespace/indent] [3] # src/sillycode.cpp:85: "Constructors callable with one argument should be marked explicit." [runtime/explicit] [5] # src/sillycode.cpp:86: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:86: "Lines should be <= 80 characters long" [whitespace/line_length] [2] # src/sillycode.cpp:94: "public: should be indented +1 space inside class Foo" [whitespace/indent] [3] # src/sillycode.cpp:100: "{ should almost always be at the end of the previous line" [whitespace/braces] [4] # src/sillycode.cpp:110: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:111: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:111: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:113: "public: should be indented +1 space inside class Vector2" [whitespace/indent] [3] # 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:122: "Weird number of spaces at line-start. Are you using a 2-space indent?" [whitespace/indent] [3] # src/sillycode.cpp:123: "Is this a non-const reference? If so, make const or use a pointer: N::X& a" [runtime/references] [2] # src/sillycode.cpp:123: "Is this a non-const reference? If so, make const or use a pointer: N::X& b" [runtime/references] [2] # src/sillycode.cpp:124: "{ should almost always be at the end of the previous line" [whitespace/braces] [4] # src/sillycode.cpp:125: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:125: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:126: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:143: "Missing spaces around =" [whitespace/operators] [4] # src/sillycode.cpp:144: "Missing spaces around =" [whitespace/operators] [4] # src/sillycode.cpp:149: "Missing spaces around =" [whitespace/operators] [4] # src/sillycode.cpp:150: "Missing spaces around =" [whitespace/operators] [4] # src/sillycode.cpp:155: "Missing spaces around =" [whitespace/operators] [4] # src/sillycode.cpp:156: "Missing spaces around =" [whitespace/operators] [4] # src/sillycode.cpp:162: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:164: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:166: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:168: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:171: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:171: "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:175: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:178: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:178: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:178: "Static/global string variables are not permitted." [runtime/string] [4] # 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:184: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:184: "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:195: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:195: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:197: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:197: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:199: "If an else has a brace on one side, it should have it on both" [readability/braces] [5] # src/sillycode.cpp:202: "An else should appear on the same line as the preceding }" [whitespace/newline] [4] # src/sillycode.cpp:202: "If an else has a brace on one side, it should have it on both" [readability/braces] [5] # src/sillycode.cpp:208: "Static/global string variables are not permitted." [runtime/string] [4] # src/sillycode.cpp:209: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:209: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:214: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:217: "{ should almost always be at the end of the previous line" [whitespace/braces] [4] # src/sillycode.cpp:218: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:218: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:219: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:219: "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:225: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:225: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:227: "Static/global string variables are not permitted." [runtime/string] [4] # src/sillycode.cpp:228: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:228: "Using C-style cast. Use reinterpret_cast(...) instead" [readability/casting] [4] # src/sillycode.cpp:236: "public: should be indented +1 space inside class derived2" [whitespace/indent] [3] # src/sillycode.cpp:241: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:243: "Lines should be <= 80 characters long" [whitespace/line_length] [2] # src/sillycode.cpp:243: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:243: "Using C-style cast. Use reinterpret_cast(...) instead" [readability/casting] [4] # src/sillycode.cpp:244: "Lines should be <= 80 characters long" [whitespace/line_length] [2] # src/sillycode.cpp:244: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:253: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:254: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:257: "Tab found; better to use spaces" [whitespace/tab] [1] # src/sillycode.cpp:257: "At least two spaces is best between code and comments" [whitespace/comments] [2] # src/sillycode.cpp:260: "Empty loop bodies should use {} or continue" [whitespace/empty_loop_body] [5] # src/sillycode.cpp:260: "At least two spaces is best between code and comments" [whitespace/comments] [2] cpplint-1.5.5/samples/silly-sample/simple.def000066400000000000000000000243601405143476300212370ustar00rootroot00000000000000src/*.cpp 1 3 Done processing src/sillycode.cpp Total errors found: 107 src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] src/sillycode.cpp:3: Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] src/sillycode.cpp:8: public: should be indented +1 space inside class Date [whitespace/indent] [3] src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector& v [runtime/references] [2] src/sillycode.cpp:15: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:39: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:40: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4] src/sillycode.cpp:49: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:49: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:55: { should almost always be at the end of the previous line [whitespace/braces] [4] 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:64: public: should be indented +1 space inside class X [whitespace/indent] [3] src/sillycode.cpp:65: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:65: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:66: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:74: public: should be indented +1 space inside class X2 [whitespace/indent] [3] src/sillycode.cpp:75: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:76: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:80: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:80: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:84: public: should be indented +1 space inside class X3 [whitespace/indent] [3] src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [5] src/sillycode.cpp:86: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:86: Lines should be <= 80 characters long [whitespace/line_length] [2] src/sillycode.cpp:94: public: should be indented +1 space inside class Foo [whitespace/indent] [3] src/sillycode.cpp:100: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:110: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:111: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:111: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:113: public: should be indented +1 space inside class Vector2 [whitespace/indent] [3] 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: Missing space after , [whitespace/comma] [3] src/sillycode.cpp:122: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] src/sillycode.cpp:122: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] src/sillycode.cpp:124: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:125: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:125: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:126: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:126: Missing space after , [whitespace/comma] [3] src/sillycode.cpp:143: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:144: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:149: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:150: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:155: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:156: Missing spaces around = [whitespace/operators] [4] src/sillycode.cpp:162: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:164: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:166: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:168: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:171: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:171: 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:175: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:178: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:178: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:178: Static/global string variables are not permitted. [runtime/string] [4] 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:184: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:184: 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:195: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:195: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:197: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:197: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:199: If an else has a brace on one side, it should have it on both [readability/braces] [5] src/sillycode.cpp:202: An else should appear on the same line as the preceding } [whitespace/newline] [4] src/sillycode.cpp:202: If an else has a brace on one side, it should have it on both [readability/braces] [5] src/sillycode.cpp:208: Missing space before { [whitespace/braces] [5] src/sillycode.cpp:208: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:209: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:209: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:214: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:217: { should almost always be at the end of the previous line [whitespace/braces] [4] src/sillycode.cpp:218: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:218: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:219: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:219: 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:225: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:225: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:227: Static/global string variables are not permitted. [runtime/string] [4] src/sillycode.cpp:228: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:228: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] src/sillycode.cpp:236: public: should be indented +1 space inside class derived2 [whitespace/indent] [3] src/sillycode.cpp:241: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:243: Lines should be <= 80 characters long [whitespace/line_length] [2] src/sillycode.cpp:243: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:243: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] src/sillycode.cpp:244: Lines should be <= 80 characters long [whitespace/line_length] [2] src/sillycode.cpp:244: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:253: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:254: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:257: Tab found; better to use spaces [whitespace/tab] [1] src/sillycode.cpp:257: At least two spaces is best between code and comments [whitespace/comments] [2] src/sillycode.cpp:260: Empty loop bodies should use {} or continue [whitespace/empty_loop_body] [5] src/sillycode.cpp:260: At least two spaces is best between code and comments [whitespace/comments] [2] cpplint-1.5.5/samples/silly-sample/src/000077500000000000000000000000001405143476300200505ustar00rootroot00000000000000cpplint-1.5.5/samples/silly-sample/src/sillycode.cpp000066400000000000000000000126151405143476300225500ustar00rootroot00000000000000#include #include 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; cpplint-1.5.5/samples/v8-sample/000077500000000000000000000000001405143476300164625ustar00rootroot00000000000000cpplint-1.5.5/samples/v8-sample/LICENSE000066400000000000000000000027701405143476300174750ustar00rootroot00000000000000Copyright 2006-2011, the V8 project authors. 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. cpplint-1.5.5/samples/v8-sample/README.md000066400000000000000000000001151405143476300177360ustar00rootroot00000000000000# V8 sample code taken for regression testing from https://github.com/v8/v8 cpplint-1.5.5/samples/v8-sample/simple.def000066400000000000000000000005701405143476300204350ustar00rootroot00000000000000src/* 1 3 Done processing src/interface-descriptors.h Total errors found: 2 src/interface-descriptors.h:5: #ifndef header guard has wrong style, please use: SAMPLES_V8_SAMPLE_SRC_INTERFACE_DESCRIPTORS_H_ [build/header_guard] [5] src/interface-descriptors.h:1255: #endif line should be "#endif // SAMPLES_V8_SAMPLE_SRC_INTERFACE_DESCRIPTORS_H_" [build/header_guard] [5] cpplint-1.5.5/samples/v8-sample/src/000077500000000000000000000000001405143476300172515ustar00rootroot00000000000000cpplint-1.5.5/samples/v8-sample/src/interface-descriptors.h000066400000000000000000001457321405143476300237350ustar00rootroot00000000000000// Copyright 2014 the V8 project 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 V8_INTERFACE_DESCRIPTORS_H_ #define V8_INTERFACE_DESCRIPTORS_H_ #include #include "src/globals.h" #include "src/isolate.h" #include "src/machine-type.h" #include "src/register-arch.h" namespace v8 { namespace internal { #define INTERFACE_DESCRIPTOR_LIST(V) \ V(Abort) \ V(Allocate) \ V(AllocateHeapNumber) \ V(ApiCallback) \ V(ApiGetter) \ V(ArgumentsAdaptor) \ V(ArrayConstructor) \ V(ArrayNArgumentsConstructor) \ V(ArrayNoArgumentConstructor) \ V(ArraySingleArgumentConstructor) \ V(AsyncFunctionStackParameter) \ V(BigIntToI64) \ V(BigIntToWasmI64) \ V(BinaryOp) \ V(CallForwardVarargs) \ V(CallFunctionTemplate) \ V(CallTrampoline) \ V(CallVarargs) \ V(CallWithArrayLike) \ V(CallWithSpread) \ V(CEntry1ArgvOnStack) \ V(CloneObjectWithVector) \ V(Compare) \ V(ConstructForwardVarargs) \ V(ConstructStub) \ V(ConstructVarargs) \ V(ConstructWithArrayLike) \ V(ConstructWithSpread) \ V(ContextOnly) \ V(CppBuiltinAdaptor) \ V(FastNewFunctionContext) \ V(FastNewObject) \ V(FrameDropperTrampoline) \ V(GetProperty) \ V(GrowArrayElements) \ V(InterpreterCEntry1) \ V(InterpreterCEntry2) \ V(InterpreterDispatch) \ V(InterpreterPushArgsThenCall) \ V(InterpreterPushArgsThenConstruct) \ V(JSTrampoline) \ V(Load) \ V(LoadGlobal) \ V(LoadGlobalWithVector) \ V(LoadWithVector) \ V(NewArgumentsElements) \ V(NoContext) \ V(RecordWrite) \ V(ResumeGenerator) \ V(RunMicrotasksEntry) \ V(RunMicrotasks) \ V(Store) \ V(StoreGlobal) \ V(StoreGlobalWithVector) \ V(StoreTransition) \ V(StoreWithVector) \ V(StringAt) \ V(StringSubstring) \ V(TypeConversion) \ V(TypeConversionStackParameter) \ V(Typeof) \ V(Void) \ V(WasmAtomicNotify) \ V(WasmI32AtomicWait) \ V(WasmI64AtomicWait) \ V(WasmMemoryGrow) \ V(WasmThrow) \ BUILTIN_LIST_TFS(V) class V8_EXPORT_PRIVATE CallInterfaceDescriptorData { public: enum Flag { kNoFlags = 0u, kNoContext = 1u << 0, // This indicates that the code uses a special frame that does not scan the // stack arguments, e.g. EntryFrame. And this allows the code to use // untagged stack arguments. kNoStackScan = 1u << 1, }; typedef base::Flags Flags; CallInterfaceDescriptorData() = default; // A copy of the passed in registers and param_representations is made // and owned by the CallInterfaceDescriptorData. void InitializePlatformSpecific(int register_parameter_count, const Register* registers); // if machine_types is null, then an array of size // (return_count + parameter_count) will be created with // MachineType::AnyTagged() for each member. // // if machine_types is not null, then it should be of the size // (return_count + parameter_count). Those members of the parameter array will // be initialized from {machine_types}, and the rest initialized to // MachineType::AnyTagged(). void InitializePlatformIndependent(Flags flags, int return_count, int parameter_count, const MachineType* machine_types, int machine_types_length); void Reset(); bool IsInitialized() const { return IsInitializedPlatformSpecific() && IsInitializedPlatformIndependent(); } Flags flags() const { return flags_; } int return_count() const { return return_count_; } int param_count() const { return param_count_; } int register_param_count() const { return register_param_count_; } Register register_param(int index) const { return register_params_[index]; } Register* register_params() const { return register_params_; } MachineType return_type(int index) const { DCHECK_LT(index, return_count_); return machine_types_[index]; } MachineType param_type(int index) const { DCHECK_LT(index, param_count_); return machine_types_[return_count_ + index]; } void RestrictAllocatableRegisters(const Register* registers, int num) { DCHECK_EQ(allocatable_registers_, 0); for (int i = 0; i < num; ++i) { allocatable_registers_ |= registers[i].bit(); } DCHECK_GT(NumRegs(allocatable_registers_), 0); } RegList allocatable_registers() const { return allocatable_registers_; } private: bool IsInitializedPlatformSpecific() const { const bool initialized = (register_param_count_ == 0 && register_params_ == nullptr) || (register_param_count_ > 0 && register_params_ != nullptr); // Platform-specific initialization happens before platform-independent. return initialized; } bool IsInitializedPlatformIndependent() const { const bool initialized = return_count_ >= 0 && param_count_ >= 0 && machine_types_ != nullptr; // Platform-specific initialization happens before platform-independent. return initialized; } #ifdef DEBUG bool AllStackParametersAreTagged() const; #endif // DEBUG int register_param_count_ = -1; int return_count_ = -1; int param_count_ = -1; Flags flags_ = kNoFlags; // Specifying the set of registers that could be used by the register // allocator. Currently, it's only used by RecordWrite code stub. RegList allocatable_registers_ = 0; // |registers_params_| defines registers that are used for parameter passing. // |machine_types_| defines machine types for resulting values and incomping // parameters. // Both arrays are allocated dynamically by the InterfaceDescriptor and // freed on destruction. This is because static arrays cause creation of // runtime static initializers which we don't want. Register* register_params_ = nullptr; MachineType* machine_types_ = nullptr; DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData); }; class V8_EXPORT_PRIVATE CallDescriptors : public AllStatic { public: enum Key { #define DEF_ENUM(name, ...) name, INTERFACE_DESCRIPTOR_LIST(DEF_ENUM) #undef DEF_ENUM NUMBER_OF_DESCRIPTORS }; static void InitializeOncePerProcess(); static void TearDown(); static CallInterfaceDescriptorData* call_descriptor_data( CallDescriptors::Key key) { return &call_descriptor_data_[key]; } static Key GetKey(const CallInterfaceDescriptorData* data) { ptrdiff_t index = data - call_descriptor_data_; DCHECK_LE(0, index); DCHECK_LT(index, CallDescriptors::NUMBER_OF_DESCRIPTORS); return static_cast(index); } private: static CallInterfaceDescriptorData call_descriptor_data_[NUMBER_OF_DESCRIPTORS]; }; class V8_EXPORT_PRIVATE CallInterfaceDescriptor { public: typedef CallInterfaceDescriptorData::Flags Flags; CallInterfaceDescriptor() : data_(nullptr) {} virtual ~CallInterfaceDescriptor() = default; explicit CallInterfaceDescriptor(CallDescriptors::Key key) : data_(CallDescriptors::call_descriptor_data(key)) {} Flags flags() const { return data()->flags(); } bool HasContextParameter() const { return (flags() & CallInterfaceDescriptorData::kNoContext) == 0; } int GetReturnCount() const { return data()->return_count(); } MachineType GetReturnType(int index) const { DCHECK_LT(index, data()->return_count()); return data()->return_type(index); } int GetParameterCount() const { return data()->param_count(); } int GetRegisterParameterCount() const { return data()->register_param_count(); } int GetStackParameterCount() const { return data()->param_count() - data()->register_param_count(); } Register GetRegisterParameter(int index) const { return data()->register_param(index); } MachineType GetParameterType(int index) const { DCHECK_LT(index, data()->param_count()); return data()->param_type(index); } RegList allocatable_registers() const { return data()->allocatable_registers(); } static const Register ContextRegister(); const char* DebugName() const; protected: const CallInterfaceDescriptorData* data() const { return data_; } virtual void InitializePlatformSpecific(CallInterfaceDescriptorData* data) { UNREACHABLE(); } virtual void InitializePlatformIndependent( CallInterfaceDescriptorData* data) { // Default descriptor configuration: one result, all parameters are passed // in registers and all parameters have MachineType::AnyTagged() type. data->InitializePlatformIndependent(CallInterfaceDescriptorData::kNoFlags, 1, data->register_param_count(), nullptr, 0); } // Initializes |data| using the platform dependent default set of registers. // It is intended to be used for TurboFan stubs when particular set of // registers does not matter. static void DefaultInitializePlatformSpecific( CallInterfaceDescriptorData* data, int register_parameter_count); // Initializes |data| using the platform dependent default set of registers // for JavaScript-compatible calling convention. // It is intended to be used for TurboFan stubs being called with JavaScript // linkage + additional parameters on registers and stack. static void JSDefaultInitializePlatformSpecific( CallInterfaceDescriptorData* data, int non_js_register_parameter_count); // Checks if float parameters are not assigned invalid registers. bool CheckFloatingPointParameters(CallInterfaceDescriptorData* data) { for (int i = 0; i < data->register_param_count(); i++) { if (IsFloatingPoint(data->param_type(i).representation())) { if (!IsValidFloatParameterRegister(data->register_param(i))) { return false; } } } return true; } bool IsValidFloatParameterRegister(Register reg); private: // {CallDescriptors} is allowed to call the private {Initialize} method. friend class CallDescriptors; const CallInterfaceDescriptorData* data_; void Initialize(CallInterfaceDescriptorData* data) { // The passed pointer should be a modifiable pointer to our own data. DCHECK_EQ(data, data_); DCHECK(!data->IsInitialized()); InitializePlatformSpecific(data); InitializePlatformIndependent(data); DCHECK(data->IsInitialized()); DCHECK(CheckFloatingPointParameters(data)); } }; #define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ public: \ explicit name() : base(key()) {} \ static inline CallDescriptors::Key key(); #if defined(V8_TARGET_ARCH_IA32) // To support all possible cases, we must limit the number of register args for // TFS builtins on ia32 to 3. Out of the 6 allocatable registers, esi is taken // as the context register and ebx is the root register. One register must // remain available to store the jump/call target. Thus 3 registers remain for // arguments. The reason this applies to TFS builtins specifically is because // this becomes relevant for builtins used as targets of Torque function // pointers (which must have a register available to store the target). // TODO(jgruber): Ideally we should just decrement kMaxBuiltinRegisterParams but // that comes with its own set of complications. It's possible, but requires // refactoring the calling convention of other existing stubs. constexpr int kMaxBuiltinRegisterParams = 4; constexpr int kMaxTFSBuiltinRegisterParams = 3; #else constexpr int kMaxBuiltinRegisterParams = 5; constexpr int kMaxTFSBuiltinRegisterParams = kMaxBuiltinRegisterParams; #endif STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams); #define DECLARE_DEFAULT_DESCRIPTOR(name, base) \ DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ protected: \ static const int kRegisterParams = \ kParameterCount > kMaxTFSBuiltinRegisterParams \ ? kMaxTFSBuiltinRegisterParams \ : kParameterCount; \ static const int kStackParams = kParameterCount - kRegisterParams; \ void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ override { \ DefaultInitializePlatformSpecific(data, kRegisterParams); \ } \ void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \ override { \ data->InitializePlatformIndependent(Flags(kDescriptorFlags), kReturnCount, \ kParameterCount, nullptr, 0); \ } \ name(CallDescriptors::Key key) : base(key) {} \ \ public: #define DECLARE_JS_COMPATIBLE_DESCRIPTOR(name, base, \ non_js_reg_parameters_count) \ DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ protected: \ void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ override { \ JSDefaultInitializePlatformSpecific(data, non_js_reg_parameters_count); \ } \ name(CallDescriptors::Key key) : base(key) {} \ \ public: #define DEFINE_RESULT_AND_PARAMETERS(return_count, ...) \ static constexpr int kDescriptorFlags = \ CallInterfaceDescriptorData::kNoFlags; \ static constexpr int kReturnCount = return_count; \ enum ParameterIndices { \ __dummy = -1, /* to be able to pass zero arguments */ \ ##__VA_ARGS__, \ \ kParameterCount, \ kContext = kParameterCount /* implicit parameter */ \ }; #define DEFINE_RESULT_AND_PARAMETERS_NO_CONTEXT(return_count, ...) \ static constexpr int kDescriptorFlags = \ CallInterfaceDescriptorData::kNoContext; \ static constexpr int kReturnCount = return_count; \ enum ParameterIndices { \ __dummy = -1, /* to be able to pass zero arguments */ \ ##__VA_ARGS__, \ \ kParameterCount \ }; // This is valid only for builtins that use EntryFrame, which does not scan // stack arguments on GC. #define DEFINE_PARAMETERS_ENTRY(...) \ static constexpr int kDescriptorFlags = \ CallInterfaceDescriptorData::kNoContext | \ CallInterfaceDescriptorData::kNoStackScan; \ static constexpr int kReturnCount = 1; \ enum ParameterIndices { \ __dummy = -1, /* to be able to pass zero arguments */ \ ##__VA_ARGS__, \ \ kParameterCount \ }; #define DEFINE_PARAMETERS(...) DEFINE_RESULT_AND_PARAMETERS(1, ##__VA_ARGS__) #define DEFINE_PARAMETERS_NO_CONTEXT(...) \ DEFINE_RESULT_AND_PARAMETERS_NO_CONTEXT(1, ##__VA_ARGS__) #define DEFINE_RESULT_AND_PARAMETER_TYPES(...) \ void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \ override { \ MachineType machine_types[] = {__VA_ARGS__}; \ static_assert( \ kReturnCount + kParameterCount == arraysize(machine_types), \ "Parameter names definition is not consistent with parameter types"); \ data->InitializePlatformIndependent(Flags(kDescriptorFlags), kReturnCount, \ kParameterCount, machine_types, \ arraysize(machine_types)); \ } #define DEFINE_PARAMETER_TYPES(...) \ DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::AnyTagged() /* result */, \ ##__VA_ARGS__) #define DEFINE_JS_PARAMETERS(...) \ static constexpr int kDescriptorFlags = \ CallInterfaceDescriptorData::kNoFlags; \ static constexpr int kReturnCount = 1; \ enum ParameterIndices { \ kTarget, \ kNewTarget, \ kActualArgumentsCount, \ ##__VA_ARGS__, \ \ kParameterCount, \ kContext = kParameterCount /* implicit parameter */ \ }; #define DEFINE_JS_PARAMETER_TYPES(...) \ DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), /* kTarget */ \ MachineType::AnyTagged(), /* kNewTarget */ \ MachineType::Int32(), /* kActualArgumentsCount */ \ ##__VA_ARGS__) #define DECLARE_DESCRIPTOR(name, base) \ DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ protected: \ void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \ name(CallDescriptors::Key key) : base(key) {} \ \ public: class V8_EXPORT_PRIVATE VoidDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS() DEFINE_PARAMETER_TYPES() DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor) }; // Dummy descriptor used to mark builtins that don't yet have their proper // descriptor associated. typedef VoidDescriptor DummyDescriptor; // Dummy descriptor that marks builtins with C calling convention. typedef VoidDescriptor CCallDescriptor; class AllocateDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kRequestedSize) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::TaggedPointer(), // result 1 MachineType::IntPtr()) // kRequestedSize DECLARE_DESCRIPTOR(AllocateDescriptor, CallInterfaceDescriptor) }; // This descriptor defines the JavaScript calling convention that can be used // by stubs: target, new.target, argc (not including the receiver) and context // are passed in registers while receiver and the rest of the JS arguments are // passed on the stack. class JSTrampolineDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS() DEFINE_JS_PARAMETER_TYPES() DECLARE_JS_COMPATIBLE_DESCRIPTOR(JSTrampolineDescriptor, CallInterfaceDescriptor, 0) }; class ContextOnlyDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS() DEFINE_PARAMETER_TYPES() DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor) }; class NoContextDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT() DEFINE_PARAMETER_TYPES() DECLARE_DESCRIPTOR(NoContextDescriptor, CallInterfaceDescriptor) }; // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs. class LoadDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kReceiver, kName, kSlot) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver MachineType::AnyTagged(), // kName MachineType::TaggedSigned()) // kSlot DECLARE_DESCRIPTOR(LoadDescriptor, CallInterfaceDescriptor) static const Register ReceiverRegister(); static const Register NameRegister(); static const Register SlotRegister(); }; class LoadGlobalDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kName, kSlot) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kName MachineType::TaggedSigned()) // kSlot DECLARE_DESCRIPTOR(LoadGlobalDescriptor, CallInterfaceDescriptor) static const Register NameRegister() { return LoadDescriptor::NameRegister(); } static const Register SlotRegister() { return LoadDescriptor::SlotRegister(); } }; class StoreDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kReceiver, kName, kValue, kSlot) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver MachineType::AnyTagged(), // kName MachineType::AnyTagged(), // kValue MachineType::TaggedSigned()) // kSlot DECLARE_DESCRIPTOR(StoreDescriptor, CallInterfaceDescriptor) static const Register ReceiverRegister(); static const Register NameRegister(); static const Register ValueRegister(); static const Register SlotRegister(); #if V8_TARGET_ARCH_IA32 static const bool kPassLastArgsOnStack = true; #else static const bool kPassLastArgsOnStack = false; #endif // Pass value and slot through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 2 : 0; }; class StoreTransitionDescriptor : public StoreDescriptor { public: DEFINE_PARAMETERS(kReceiver, kName, kMap, kValue, kSlot, kVector) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver MachineType::AnyTagged(), // kName MachineType::AnyTagged(), // kMap MachineType::AnyTagged(), // kValue MachineType::TaggedSigned(), // kSlot MachineType::AnyTagged()) // kVector DECLARE_DESCRIPTOR(StoreTransitionDescriptor, StoreDescriptor) static const Register MapRegister(); static const Register SlotRegister(); static const Register VectorRegister(); // Pass value, slot and vector through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 3 : 0; }; class StoreWithVectorDescriptor : public StoreDescriptor { public: DEFINE_PARAMETERS(kReceiver, kName, kValue, kSlot, kVector) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver MachineType::AnyTagged(), // kName MachineType::AnyTagged(), // kValue MachineType::TaggedSigned(), // kSlot MachineType::AnyTagged()) // kVector DECLARE_DESCRIPTOR(StoreWithVectorDescriptor, StoreDescriptor) static const Register VectorRegister(); // Pass value, slot and vector through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 3 : 0; }; class StoreGlobalDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kName, kValue, kSlot) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kName MachineType::AnyTagged(), // kValue MachineType::TaggedSigned()) // kSlot DECLARE_DESCRIPTOR(StoreGlobalDescriptor, CallInterfaceDescriptor) static const bool kPassLastArgsOnStack = StoreDescriptor::kPassLastArgsOnStack; // Pass value and slot through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 2 : 0; static const Register NameRegister() { return StoreDescriptor::NameRegister(); } static const Register ValueRegister() { return StoreDescriptor::ValueRegister(); } static const Register SlotRegister() { return StoreDescriptor::SlotRegister(); } }; class StoreGlobalWithVectorDescriptor : public StoreGlobalDescriptor { public: DEFINE_PARAMETERS(kName, kValue, kSlot, kVector) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kName MachineType::AnyTagged(), // kValue MachineType::TaggedSigned(), // kSlot MachineType::AnyTagged()) // kVector DECLARE_DESCRIPTOR(StoreGlobalWithVectorDescriptor, StoreGlobalDescriptor) static const Register VectorRegister() { return StoreWithVectorDescriptor::VectorRegister(); } // Pass value, slot and vector through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 3 : 0; }; class LoadWithVectorDescriptor : public LoadDescriptor { public: DEFINE_PARAMETERS(kReceiver, kName, kSlot, kVector) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver MachineType::AnyTagged(), // kName MachineType::TaggedSigned(), // kSlot MachineType::AnyTagged()) // kVector DECLARE_DESCRIPTOR(LoadWithVectorDescriptor, LoadDescriptor) static const Register VectorRegister(); #if V8_TARGET_ARCH_IA32 static const bool kPassLastArgsOnStack = true; #else static const bool kPassLastArgsOnStack = false; #endif // Pass vector through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 1 : 0; }; class LoadGlobalWithVectorDescriptor : public LoadGlobalDescriptor { public: DEFINE_PARAMETERS(kName, kSlot, kVector) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kName MachineType::TaggedSigned(), // kSlot MachineType::AnyTagged()) // kVector DECLARE_DESCRIPTOR(LoadGlobalWithVectorDescriptor, LoadGlobalDescriptor) #if V8_TARGET_ARCH_IA32 // On ia32, LoadWithVectorDescriptor passes vector on the stack and thus we // need to choose a new register here. static const Register VectorRegister() { return edx; } #else static const Register VectorRegister() { return LoadWithVectorDescriptor::VectorRegister(); } #endif }; class FastNewFunctionContextDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kScopeInfo, kSlots) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kScopeInfo MachineType::Int32()) // kSlots DECLARE_DESCRIPTOR(FastNewFunctionContextDescriptor, CallInterfaceDescriptor) static const Register ScopeInfoRegister(); static const Register SlotsRegister(); }; class FastNewObjectDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kTarget, kNewTarget) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget MachineType::AnyTagged()) // kNewTarget DECLARE_DESCRIPTOR(FastNewObjectDescriptor, CallInterfaceDescriptor) static const Register TargetRegister(); static const Register NewTargetRegister(); }; class RecordWriteDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kObject, kSlot, kRememberedSet, kFPMode) DEFINE_PARAMETER_TYPES(MachineType::TaggedPointer(), // kObject MachineType::Pointer(), // kSlot MachineType::TaggedSigned(), // kRememberedSet MachineType::TaggedSigned()) // kFPMode DECLARE_DESCRIPTOR(RecordWriteDescriptor, CallInterfaceDescriptor) }; class TypeConversionDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kArgument) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged()) DECLARE_DESCRIPTOR(TypeConversionDescriptor, CallInterfaceDescriptor) static const Register ArgumentRegister(); }; class TypeConversionStackParameterDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kArgument) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged()) DECLARE_DESCRIPTOR(TypeConversionStackParameterDescriptor, CallInterfaceDescriptor) }; class AsyncFunctionStackParameterDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kPromise, kResult) DEFINE_PARAMETER_TYPES(MachineType::TaggedPointer(), MachineType::AnyTagged()) DECLARE_DESCRIPTOR(AsyncFunctionStackParameterDescriptor, CallInterfaceDescriptor) }; class GetPropertyDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kObject, kKey) DECLARE_DEFAULT_DESCRIPTOR(GetPropertyDescriptor, CallInterfaceDescriptor) }; class TypeofDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kObject) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged()) DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor) }; class CallTrampolineDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kFunction, kActualArgumentsCount) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction MachineType::Int32()) // kActualArgumentsCount DECLARE_DESCRIPTOR(CallTrampolineDescriptor, CallInterfaceDescriptor) }; class CallVarargsDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kTarget, kActualArgumentsCount, kArgumentsLength, kArgumentsList) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget MachineType::Int32(), // kActualArgumentsCount MachineType::Int32(), // kArgumentsLength MachineType::AnyTagged()) // kArgumentsList DECLARE_DESCRIPTOR(CallVarargsDescriptor, CallInterfaceDescriptor) }; class CallForwardVarargsDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kTarget, kActualArgumentsCount, kStartIndex) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget MachineType::Int32(), // kActualArgumentsCount MachineType::Int32()) // kStartIndex DECLARE_DESCRIPTOR(CallForwardVarargsDescriptor, CallInterfaceDescriptor) }; class CallFunctionTemplateDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kFunctionTemplateInfo, kArgumentsCount) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunctionTemplateInfo MachineType::IntPtr()) // kArgumentsCount DECLARE_DESCRIPTOR(CallFunctionTemplateDescriptor, CallInterfaceDescriptor) }; class CallWithSpreadDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kTarget, kArgumentsCount, kSpread) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget MachineType::Int32(), // kArgumentsCount MachineType::AnyTagged()) // kSpread DECLARE_DESCRIPTOR(CallWithSpreadDescriptor, CallInterfaceDescriptor) }; class CallWithArrayLikeDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kTarget, kArgumentsList) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget MachineType::AnyTagged()) // kArgumentsList DECLARE_DESCRIPTOR(CallWithArrayLikeDescriptor, CallInterfaceDescriptor) }; class ConstructVarargsDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS(kArgumentsLength, kArgumentsList) DEFINE_JS_PARAMETER_TYPES(MachineType::Int32(), // kArgumentsLength MachineType::AnyTagged()) // kArgumentsList DECLARE_DESCRIPTOR(ConstructVarargsDescriptor, CallInterfaceDescriptor) }; class ConstructForwardVarargsDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS(kStartIndex) DEFINE_JS_PARAMETER_TYPES(MachineType::Int32()) DECLARE_DESCRIPTOR(ConstructForwardVarargsDescriptor, CallInterfaceDescriptor) }; class ConstructWithSpreadDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS(kSpread) DEFINE_JS_PARAMETER_TYPES(MachineType::AnyTagged()) DECLARE_DESCRIPTOR(ConstructWithSpreadDescriptor, CallInterfaceDescriptor) }; class ConstructWithArrayLikeDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kTarget, kNewTarget, kArgumentsList) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget MachineType::AnyTagged(), // kNewTarget MachineType::AnyTagged()) // kArgumentsList DECLARE_DESCRIPTOR(ConstructWithArrayLikeDescriptor, CallInterfaceDescriptor) }; // TODO(ishell): consider merging this with ArrayConstructorDescriptor class ConstructStubDescriptor : public CallInterfaceDescriptor { public: // TODO(jgruber): Remove the unused allocation site parameter. DEFINE_JS_PARAMETERS(kAllocationSite) DEFINE_JS_PARAMETER_TYPES(MachineType::AnyTagged()) // TODO(ishell): Use DECLARE_JS_COMPATIBLE_DESCRIPTOR if registers match DECLARE_DESCRIPTOR(ConstructStubDescriptor, CallInterfaceDescriptor) }; class AbortDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kMessageOrMessageId) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged()) DECLARE_DESCRIPTOR(AbortDescriptor, CallInterfaceDescriptor) }; class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT() DEFINE_PARAMETER_TYPES() DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor) }; class ArrayConstructorDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS(kAllocationSite) DEFINE_JS_PARAMETER_TYPES(MachineType::AnyTagged()) DECLARE_JS_COMPATIBLE_DESCRIPTOR(ArrayConstructorDescriptor, CallInterfaceDescriptor, 1) }; class ArrayNArgumentsConstructorDescriptor : public CallInterfaceDescriptor { public: // This descriptor declares only register arguments while respective number // of JS arguments stay on the expression stack. // The ArrayNArgumentsConstructor builtin does not access stack arguments // directly it just forwards them to the runtime function. DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction, MachineType::AnyTagged(), // kAllocationSite MachineType::Int32()) // kActualArgumentsCount DECLARE_DESCRIPTOR(ArrayNArgumentsConstructorDescriptor, CallInterfaceDescriptor) }; class ArrayNoArgumentConstructorDescriptor : public ArrayNArgumentsConstructorDescriptor { public: // This descriptor declares same register arguments as the parent // ArrayNArgumentsConstructorDescriptor and it declares indices for // JS arguments passed on the expression stack. DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction MachineType::AnyTagged(), // kAllocationSite MachineType::Int32(), // kActualArgumentsCount MachineType::AnyTagged()) // kFunctionParameter DECLARE_DESCRIPTOR(ArrayNoArgumentConstructorDescriptor, ArrayNArgumentsConstructorDescriptor) }; class ArraySingleArgumentConstructorDescriptor : public ArrayNArgumentsConstructorDescriptor { public: // This descriptor declares same register arguments as the parent // ArrayNArgumentsConstructorDescriptor and it declares indices for // JS arguments passed on the expression stack. DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter, kArraySizeSmiParameter) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction MachineType::AnyTagged(), // kAllocationSite MachineType::Int32(), // kActualArgumentsCount MachineType::AnyTagged(), // kFunctionParameter MachineType::AnyTagged()) // kArraySizeSmiParameter DECLARE_DESCRIPTOR(ArraySingleArgumentConstructorDescriptor, ArrayNArgumentsConstructorDescriptor) }; class CompareDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kLeft, kRight) DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor) }; class BinaryOpDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kLeft, kRight) DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor) }; // This desciptor is shared among String.p.charAt/charCodeAt/codePointAt // as they all have the same interface. class StringAtDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kReceiver, kPosition) // TODO(turbofan): Return untagged value here. DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::TaggedSigned(), // result 1 MachineType::AnyTagged(), // kReceiver MachineType::IntPtr()) // kPosition DECLARE_DESCRIPTOR(StringAtDescriptor, CallInterfaceDescriptor) }; class StringSubstringDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kString, kFrom, kTo) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kString MachineType::IntPtr(), // kFrom MachineType::IntPtr()) // kTo // TODO(turbofan): Allow builtins to return untagged values. DECLARE_DESCRIPTOR(StringSubstringDescriptor, CallInterfaceDescriptor) }; class ArgumentsAdaptorDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS(kExpectedArgumentsCount) DEFINE_JS_PARAMETER_TYPES(MachineType::Int32()) DECLARE_DESCRIPTOR(ArgumentsAdaptorDescriptor, CallInterfaceDescriptor) }; class CppBuiltinAdaptorDescriptor : public CallInterfaceDescriptor { public: DEFINE_JS_PARAMETERS(kCFunction) DEFINE_JS_PARAMETER_TYPES(MachineType::Pointer()) DECLARE_JS_COMPATIBLE_DESCRIPTOR(CppBuiltinAdaptorDescriptor, CallInterfaceDescriptor, 1) }; class CEntry1ArgvOnStackDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kArity, // register argument kCFunction, // register argument kPadding, // stack argument 1 (just padding) kArgcSmi, // stack argument 2 kTargetCopy, // stack argument 3 kNewTargetCopy) // stack argument 4 DEFINE_PARAMETER_TYPES(MachineType::Int32(), // kArity MachineType::Pointer(), // kCFunction MachineType::AnyTagged(), // kPadding MachineType::AnyTagged(), // kArgcSmi MachineType::AnyTagged(), // kTargetCopy MachineType::AnyTagged()) // kNewTargetCopy DECLARE_DESCRIPTOR(CEntry1ArgvOnStackDescriptor, CallInterfaceDescriptor) }; class ApiCallbackDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kApiFunctionAddress, kActualArgumentsCount, kCallData, kHolder) // receiver is implicit stack argument 1 // argv are implicit stack arguments [2, 2 + kArgc[ DEFINE_PARAMETER_TYPES(MachineType::Pointer(), // kApiFunctionAddress MachineType::IntPtr(), // kActualArgumentsCount MachineType::AnyTagged(), // kCallData MachineType::AnyTagged()) // kHolder DECLARE_DESCRIPTOR(ApiCallbackDescriptor, CallInterfaceDescriptor) }; class ApiGetterDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kReceiver, kHolder, kCallback) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kReceiver MachineType::AnyTagged(), // kHolder MachineType::AnyTagged()) // kCallback DECLARE_DESCRIPTOR(ApiGetterDescriptor, CallInterfaceDescriptor) static const Register ReceiverRegister(); static const Register HolderRegister(); static const Register CallbackRegister(); }; // TODO(turbofan): We should probably rename this to GrowFastElementsDescriptor. class GrowArrayElementsDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kObject, kKey) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kObject MachineType::AnyTagged()) // kKey DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor) static const Register ObjectRegister(); static const Register KeyRegister(); }; class NewArgumentsElementsDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kFrame, kLength, kMappedCount) DEFINE_PARAMETER_TYPES(MachineType::Pointer(), // kFrame MachineType::TaggedSigned(), // kLength MachineType::TaggedSigned()) // kMappedCount DECLARE_DESCRIPTOR(NewArgumentsElementsDescriptor, CallInterfaceDescriptor) }; class V8_EXPORT_PRIVATE InterpreterDispatchDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kAccumulator, kBytecodeOffset, kBytecodeArray, kDispatchTable) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kAccumulator MachineType::IntPtr(), // kBytecodeOffset MachineType::AnyTagged(), // kBytecodeArray MachineType::IntPtr()) // kDispatchTable DECLARE_DESCRIPTOR(InterpreterDispatchDescriptor, CallInterfaceDescriptor) }; class InterpreterPushArgsThenCallDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kNumberOfArguments, kFirstArgument, kFunction) DEFINE_PARAMETER_TYPES(MachineType::Int32(), // kNumberOfArguments MachineType::Pointer(), // kFirstArgument MachineType::AnyTagged()) // kFunction DECLARE_DESCRIPTOR(InterpreterPushArgsThenCallDescriptor, CallInterfaceDescriptor) }; class InterpreterPushArgsThenConstructDescriptor : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kNumberOfArguments, kFirstArgument, kConstructor, kNewTarget, kFeedbackElement) DEFINE_PARAMETER_TYPES(MachineType::Int32(), // kNumberOfArguments MachineType::Pointer(), // kFirstArgument MachineType::AnyTagged(), // kConstructor MachineType::AnyTagged(), // kNewTarget MachineType::AnyTagged()) // kFeedbackElement DECLARE_DESCRIPTOR(InterpreterPushArgsThenConstructDescriptor, CallInterfaceDescriptor) #if V8_TARGET_ARCH_IA32 static const bool kPassLastArgsOnStack = true; #else static const bool kPassLastArgsOnStack = false; #endif // Pass constructor, new target and feedback element through the stack. static const int kStackArgumentsCount = kPassLastArgsOnStack ? 3 : 0; }; class InterpreterCEntry1Descriptor : public CallInterfaceDescriptor { public: DEFINE_RESULT_AND_PARAMETERS(1, kNumberOfArguments, kFirstArgument, kFunctionEntry) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::AnyTagged(), // result 1 MachineType::Int32(), // kNumberOfArguments MachineType::Pointer(), // kFirstArgument MachineType::Pointer()) // kFunctionEntry DECLARE_DESCRIPTOR(InterpreterCEntry1Descriptor, CallInterfaceDescriptor) }; class InterpreterCEntry2Descriptor : public CallInterfaceDescriptor { public: DEFINE_RESULT_AND_PARAMETERS(2, kNumberOfArguments, kFirstArgument, kFunctionEntry) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::AnyTagged(), // result 1 MachineType::AnyTagged(), // result 2 MachineType::Int32(), // kNumberOfArguments MachineType::Pointer(), // kFirstArgument MachineType::Pointer()) // kFunctionEntry DECLARE_DESCRIPTOR(InterpreterCEntry2Descriptor, CallInterfaceDescriptor) }; class ResumeGeneratorDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kValue, kGenerator) DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kValue MachineType::AnyTagged()) // kGenerator DECLARE_DESCRIPTOR(ResumeGeneratorDescriptor, CallInterfaceDescriptor) }; class FrameDropperTrampolineDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kRestartFp) DEFINE_PARAMETER_TYPES(MachineType::Pointer()) DECLARE_DESCRIPTOR(FrameDropperTrampolineDescriptor, CallInterfaceDescriptor) }; class RunMicrotasksEntryDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_ENTRY(kRootRegisterValue, kMicrotaskQueue) DEFINE_PARAMETER_TYPES(MachineType::Pointer(), // kRootRegisterValue MachineType::Pointer()) // kMicrotaskQueue DECLARE_DESCRIPTOR(RunMicrotasksEntryDescriptor, CallInterfaceDescriptor) }; class RunMicrotasksDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kMicrotaskQueue) DEFINE_PARAMETER_TYPES(MachineType::Pointer()) DECLARE_DESCRIPTOR(RunMicrotasksDescriptor, CallInterfaceDescriptor) static Register MicrotaskQueueRegister(); }; class WasmMemoryGrowDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kNumPages) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::Int32(), // result 1 MachineType::Int32()) // kNumPages DECLARE_DESCRIPTOR(WasmMemoryGrowDescriptor, CallInterfaceDescriptor) }; class WasmThrowDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kException) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::AnyTagged(), // result 1 MachineType::AnyTagged()) // kException DECLARE_DESCRIPTOR(WasmThrowDescriptor, CallInterfaceDescriptor) }; class BigIntToWasmI64Descriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kArgument) DEFINE_PARAMETER_TYPES(MachineType::Int64()) // kArgument DECLARE_DESCRIPTOR(BigIntToWasmI64Descriptor, CallInterfaceDescriptor) }; class BigIntToI64Descriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kArgument) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::Int64(), // result 1 MachineType::AnyTagged()) // kArgument DECLARE_DESCRIPTOR(BigIntToI64Descriptor, CallInterfaceDescriptor) }; class WasmAtomicNotifyDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kAddress, kCount) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::Uint32(), // result 1 MachineType::Uint32(), // kAddress MachineType::Uint32()) // kCount DECLARE_DESCRIPTOR(WasmAtomicNotifyDescriptor, CallInterfaceDescriptor) }; class WasmI32AtomicWaitDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kAddress, kExpectedValue, kTimeout) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::Uint32(), // result 1 MachineType::Uint32(), // kAddress MachineType::Int32(), // kExpectedValue MachineType::Float64()) // kTimeout DECLARE_DESCRIPTOR(WasmI32AtomicWaitDescriptor, CallInterfaceDescriptor) }; class WasmI64AtomicWaitDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS_NO_CONTEXT(kAddress, kExpectedValueHigh, kExpectedValueLow, kTimeout) DEFINE_RESULT_AND_PARAMETER_TYPES( MachineType::Uint32(), // result 1 MachineType::Uint32(), // kAddress MachineType::Uint32(), // kExpectedValueHigh MachineType::Uint32(), // kExpectedValueLow MachineType::Float64()) // kTimeout DECLARE_DESCRIPTOR(WasmI64AtomicWaitDescriptor, CallInterfaceDescriptor) }; class CloneObjectWithVectorDescriptor final : public CallInterfaceDescriptor { public: DEFINE_PARAMETERS(kSource, kFlags, kSlot, kVector) DEFINE_RESULT_AND_PARAMETER_TYPES(MachineType::TaggedPointer(), // result 1 MachineType::AnyTagged(), // kSource MachineType::TaggedSigned(), // kFlags MachineType::TaggedSigned(), // kSlot MachineType::AnyTagged()) // kVector DECLARE_DESCRIPTOR(CloneObjectWithVectorDescriptor, CallInterfaceDescriptor) }; #define DEFINE_TFS_BUILTIN_DESCRIPTOR(Name, ...) \ class Name##Descriptor : public CallInterfaceDescriptor { \ public: \ DEFINE_PARAMETERS(__VA_ARGS__) \ DECLARE_DEFAULT_DESCRIPTOR(Name##Descriptor, CallInterfaceDescriptor) \ }; BUILTIN_LIST_TFS(DEFINE_TFS_BUILTIN_DESCRIPTOR) #undef DEFINE_TFS_BUILTIN_DESCRIPTOR #undef DECLARE_DEFAULT_DESCRIPTOR #undef DECLARE_DESCRIPTOR_WITH_BASE #undef DECLARE_DESCRIPTOR #undef DECLARE_JS_COMPATIBLE_DESCRIPTOR #undef DEFINE_RESULT_AND_PARAMETERS #undef DEFINE_RESULT_AND_PARAMETERS_NO_CONTEXT #undef DEFINE_PARAMETERS #undef DEFINE_PARAMETERS_NO_CONTEXT #undef DEFINE_RESULT_AND_PARAMETER_TYPES #undef DEFINE_PARAMETER_TYPES #undef DEFINE_JS_PARAMETERS #undef DEFINE_JS_PARAMETER_TYPES // We define the association between CallDescriptors::Key and the specialized // descriptor here to reduce boilerplate and mistakes. #define DEF_KEY(name, ...) \ CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; } INTERFACE_DESCRIPTOR_LIST(DEF_KEY) #undef DEF_KEY } // namespace internal } // namespace v8 #endif // V8_INTERFACE_DESCRIPTORS_H_ cpplint-1.5.5/samples/vlc-sample/000077500000000000000000000000001405143476300167115ustar00rootroot00000000000000cpplint-1.5.5/samples/vlc-sample/COPYING000066400000000000000000000432551405143476300177550ustar00rootroot00000000000000 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. cpplint-1.5.5/samples/vlc-sample/README.md000066400000000000000000000001251405143476300201660ustar00rootroot00000000000000# VLC sample code taken for regression testing from https://github.com/videolan/vlc cpplint-1.5.5/samples/vlc-sample/simple.def000066400000000000000000001407431405143476300206730ustar00rootroot00000000000000src/* 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] cpplint-1.5.5/samples/vlc-sample/src/000077500000000000000000000000001405143476300175005ustar00rootroot00000000000000cpplint-1.5.5/samples/vlc-sample/src/libvlc.c000066400000000000000000000512171405143476300211250ustar00rootroot00000000000000/***************************************************************************** * 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; } cpplint-1.5.5/samples/vlc-sample/src/libvlc.h000066400000000000000000000146441405143476300211350ustar00rootroot00000000000000/***************************************************************************** * 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 cpplint-1.5.5/samples/vlc-sample/src/missing.c000066400000000000000000000255021405143476300213210ustar00rootroot00000000000000/***************************************************************************** * 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 */ cpplint-1.5.5/setup.cfg000066400000000000000000000003631405143476300150250ustar00rootroot00000000000000[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 cpplint-1.5.5/setup.py000077500000000000000000000056201405143476300147220ustar00rootroot00000000000000#! /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 [line for line in f.read().splitlines() if not len(line) == 0 and not line.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.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', '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==5.2" ], 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 }) cpplint-1.5.5/test-requirements000066400000000000000000000003221405143476300166220ustar00rootroot00000000000000# 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 testfixtures cpplint-1.5.5/tox.ini000066400000000000000000000005571405143476300145240ustar00rootroot00000000000000[tox] envlist = py27, py36, py37, py38, pypy, pypy3 [testenv] deps = py38: flake8>=3.7.8 py38: radon>=2.4.0 py38: pylint>=1.8.4 py38: flake8-polyfill py35: importlib-metadata>=0.12 py27: importlib-metadata>=0.12 pypy: importlib-metadata>=0.12 commands = {envpython} setup.py test py38: {envpython} setup.py lint py38: {envpython} setup.py style